Skip to content

Commit

Permalink
final cleaned version of jquery selectors (from jquery docs)
Browse files Browse the repository at this point in the history
git-svn-id: https://ennerchi.googlecode.com/svn/trunk/plugins/jrails@75 1bc9508b-f83e-0410-b78e-05f979d4f8d9
  • Loading branch information
aaronchi committed Jul 4, 2008
1 parent 65fab48 commit 95bfcb3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/jrails.rb
Expand Up @@ -19,7 +19,7 @@ def javascript_function(*args, &block)
end

def jquery_id(id)
id.to_s.count('.#>[]*=@:/ ') == 0 ? "##{id}" : id
id.to_s.count('#.*,>+~:[ ') == 0 ? "##{id}" : id
end

def jquery_ids(ids)
Expand Down Expand Up @@ -104,7 +104,7 @@ def toggle(*ids)
end

def jquery_id(id)
id.to_s.count('.#>[]*=@:/ ') == 0 ? "##{id}" : id
id.to_s.count('#.*,>+~:[ ') == 0 ? "##{id}" : id
end

def jquery_ids(ids)
Expand Down Expand Up @@ -229,7 +229,7 @@ class JavaScriptElementProxy < JavaScriptProxy #:nodoc:
end

def initialize(generator, id)
id = id.to_s.count('.#>[]*=@:/ ') == 0 ? "##{id}" : id
id = id.to_s.count('#.*,>+~:[ ') == 0 ? "##{id}" : id
@id = id
super(generator, "#{JQUERY_VAR}(\"#{id}\")")
end
Expand Down

0 comments on commit 95bfcb3

Please sign in to comment.