Class: JSEvent
Overview
TODO: We need to figure out how we want to wrap JS events
Instance Attribute Summary collapse
-
#js_event ⇒ Object
readonly
Returns the value of attribute js_event.
Instance Method Summary collapse
-
#initialize(js_event) ⇒ JSEvent
constructor
A new instance of JSEvent.
- #key_code ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(js_event) ⇒ JSEvent
Returns a new instance of JSEvent.
6 7 8 |
# File 'lib/volt/templates/event_binding.rb', line 6 def initialize(js_event) @js_event = js_event end |
Instance Attribute Details
#js_event ⇒ Object (readonly)
Returns the value of attribute js_event.
5 6 7 |
# File 'lib/volt/templates/event_binding.rb', line 5 def js_event @js_event end |
Instance Method Details
#key_code ⇒ Object
10 11 12 |
# File 'lib/volt/templates/event_binding.rb', line 10 def key_code `this.js_event.keyCode` end |
#stop ⇒ Object
14 15 16 17 18 |
# File 'lib/volt/templates/event_binding.rb', line 14 def stop # puts "STOPPING" # `this.js_event.stopPropagation();` `this.js_event.preventDefault();` end |