Skip to content

Commit

Permalink
Add alias for get_elements_by_tag_name
Browse files Browse the repository at this point in the history
  • Loading branch information
jschementi committed May 28, 2008
1 parent bdb831b commit c7b0c92
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion vendor/plugins/silverline/client/lib/helpers/html/patch.rb
Expand Up @@ -13,6 +13,11 @@ def method_missing(m, *args)
def get_element_by_id(id)
orig_get_element_by_id(id.to_s.to_clr_string)
end

alias_method :orig_get_elements_by_tag_name, :get_elements_by_tag_name
def get_elements_by_tag_name(name)
orig_get_elements_by_tag_name(name.to_s.to_clr_string)
end
end

class HtmlElementCollection
Expand All @@ -28,6 +33,9 @@ def first
def last
self[size - 1] if size > 0
end
def empty?
size == 0
end
end

class HtmlElement
Expand All @@ -45,7 +53,7 @@ def []=(index, value)
def method_missing(m, *args, &block)
super
rescue => e
if(block.nil?)
if block.nil?
if m.to_s[-1..-1] == "="
self[m.to_s[0..-2]] = args.first
else
Expand Down Expand Up @@ -94,6 +102,7 @@ def get_style_attribute(index)
def set_style_attribute(index, value)
orig_set_style_attribute(index.to_s.to_clr_string, value)
end

end

class HtmlStyle
Expand Down

0 comments on commit c7b0c92

Please sign in to comment.