diff --git a/motion/ruby_motion_query/animations.rb b/motion/ruby_motion_query/animations.rb index 74a8e49..579875b 100644 --- a/motion/ruby_motion_query/animations.rb +++ b/motion/ruby_motion_query/animations.rb @@ -83,19 +83,21 @@ module RubyMotionQuery end # @return [RMQ] - def throb + def throb(opts = {}) + opts.merge!({ + duration: 0.4, + animations: -> (cq) { + cq.style {|st| st.scale = 1.0} + } + }) + @rmq.animate( duration: 0.1, animations: -> (q) { q.style {|st| st.scale = 1.1} }, completion: -> (did_finish, q) { - q.animate( - duration: 0.4, - animations: -> (cq) { - cq.style {|st| st.scale = 1.0} - } - ) + q.animate(opts) } ) end diff --git a/motion/ruby_motion_query/stylesheet.rb b/motion/ruby_motion_query/stylesheet.rb index 8561c34..df5857b 100644 --- a/motion/ruby_motion_query/stylesheet.rb +++ b/motion/ruby_motion_query/stylesheet.rb @@ -44,7 +44,7 @@ module RubyMotionQuery def reapply_styles selected.each do |selected_view| if style_name = selected_view.rmq_data.style_name - apply_style_to_view selected_view, style_name + apply_style_to_view selected_view, style_name end end self