Permalink
Browse files

Renamed to ujs_sort_helper, added jQuery version

  • Loading branch information...
1 parent dc93fdb commit 43d968688e4eae87782fd03e386730116d2c34f4 Wynn Netherland committed Apr 21, 2008
View
13 README
@@ -39,11 +39,20 @@ styles for nifty sort arrow images
<%= javascript_include_tag :defaults%>
as long as prototype.js is included before lowpro and ujs_sort_helper
+If you're not using jQuery, reference Dan Webb's lowpro and the Prototype version
+of the ujs_sort_helper:
+
<%= javascript_include_tag "lowpro"%>
you SHOULD already have this ;-)
- <%= javascript_include_tag "usj_sort_helper"%>
-this is where ujs comes in
+ <%= javascript_include_tag "ujs_sort_helper"%>
+
+If you're using jQuery, simply include the jQuery version (assuming you already
+have jQuery and livequery installed)
+
+<%= javascript_include_tag "ujs_sort_helper.jquery.js"%>
+
+
====View (table header in index.rhtml):
<thead>
View
@@ -5,14 +5,14 @@ require 'rake/rdoctask'
desc 'Default: run unit tests.'
task :default => :test
-desc 'Test the unobtrusive_sort_helper plugin.'
+desc 'Test the ujs_sort_helper plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
-desc 'Generate documentation for the unobtrusive_sort_helper plugin.'
+desc 'Generate documentation for the ujs_sort_helper plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'UnobtrusiveSortHelper'
View
@@ -1,7 +1,7 @@
-require 'unobtrusive_sort_helper'
+require 'ujs_sort_helper'
-ActionView::Base.send(:include, UnobtrusiveSortHelper)
-ActionController::Base.send(:include, UnobtrusiveSortHelper)
+ActionView::Base.send(:include, UjsSortHelper)
+ActionController::Base.send(:include, UjsSortHelper)
# install files
['/public/javascripts', '/public/stylesheets', '/public/images'].each{|dir|
File renamed without changes.
@@ -0,0 +1,13 @@
+
+jQuery(document).ready(function() {
+ jQuery('a.sort_link').livequery('click', function(e) {
+ jQuery('#surveys-grid').load(e.target.href + " table#surveys-grid");
+ return false;
+ });
+
+ jQuery('div.pagination a').livequery('click', function(e) {
+ jQuery('#surveys-grid').load(e.target.href + " table#surveys-grid");
+ return false;
+ });
+});
+
Oops, something went wrong.

0 comments on commit 43d9686

Please sign in to comment.