lib/assets/javascripts/opal/jquery/event.rb in opal-jquery-0.0.4 vs lib/assets/javascripts/opal/jquery/event.rb in opal-jquery-0.0.5

- old
+ new

@@ -8,10 +8,15 @@ `$(#{self}.currentTarget)` end alias_native :default_prevented?, :isDefaultPrevented + def kill + stop_propagation + prevent_default + end + alias_native :prevent_default, :preventDefault def page_x `#{self}.pageX` end @@ -26,9 +31,17 @@ alias_native :stop_immediate_propagation, :stopImmediatePropagation def target `$(#{self}.target)` + end + + def touch_x + `#{self}.originalEvent.touches[0].pageX` + end + + def touch_y + `#{self}.originalEvent.touches[0].pageY` end def type `#{self}.type` end