Skip to content

Commit

Permalink
Change to_native => to_n for latest opal
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Jun 9, 2013
1 parent 4789dda commit 2f38015
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions opal/opal-jquery/element.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def css(name, value=nil)
if value.nil? && name.is_a?(String)
return `#{self}.css(name)`
else
name.is_a?(Hash) ? `#{self}.css(#{name.to_native})` : `#{self}.css(name, value)`
name.is_a?(Hash) ? `#{self}.css(#{name.to_n})` : `#{self}.css(name, value)`
end
self
end
Expand All @@ -228,7 +228,7 @@ def css(name, value=nil)
def animate(params, &block)
speed = params.has_key?(:speed) ? params.delete(:speed) : 400
%x{
#{self}.animate(#{params.to_native}, #{speed}, function() {
#{self}.animate(#{params.to_n}, #{speed}, function() {
#{block.call if block_given?}
})
}
Expand All @@ -239,7 +239,7 @@ def animate(params, &block)
# Also accepts additional arguments and a block for the finished callback.
def effect(name, *args, &block)
name = name.gsub(/_\w/) { |match| match[1].upcase }
args = args.map { |a| a.to_native if a.respond_to? :to_native }.compact
args = args.map { |a| a.to_n if a.respond_to? :to_n }.compact
args << `function() { #{block.call if block_given?} }`
`#{self}[#{name}].apply(#{self}, #{args})`
end
Expand Down
2 changes: 1 addition & 1 deletion opal/opal-jquery/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def initialize(url, method, options, handler=nil)
@xhr = nil
http = self
payload = options.delete :payload
settings = options.to_native
settings = options.to_n

if handler
@callback = @errback = handler
Expand Down

0 comments on commit 2f38015

Please sign in to comment.