Class: Dommy::HashChangeEvent
Overview
HashChangeEvent — fired on the window when the URL fragment changes (a
fragment-navigation link, location.hash = ...). Exposes the full document
URL before and after the change as oldURL / newURL (spec USVStrings). A
plain Event subclass, NOT a CustomEvent.
Constant Summary
Constants inherited from Event
Event::AT_TARGET, Event::BUBBLING_PHASE, Event::CAPTURING_PHASE, Event::NONE
Instance Attribute Summary collapse
-
#new_url ⇒ Object
readonly
Returns the value of attribute new_url.
-
#old_url ⇒ Object
readonly
Returns the value of attribute old_url.
Attributes inherited from Event
Instance Method Summary collapse
- #__js_get__(key) ⇒ Object
-
#initialize(type, init = nil) ⇒ HashChangeEvent
constructor
A new instance of HashChangeEvent.
Methods inherited from Event
#__internal_clear_propagation_flags__, #__internal_mark_trusted__, #__internal_prepare_for_dispatch__, #__internal_record_path__, #__internal_run_passive__, #__internal_set_current_target__, #__internal_set_dispatch_flag__, #__internal_set_event_phase__, #__js_call__, #__js_set__, #bubbles?, #default_prevented?, #immediate_propagation_stopped?, #init_event, #propagation_stopped?
Methods included from Bridge::Methods
Constructor Details
#initialize(type, init = nil) ⇒ HashChangeEvent
Returns a new instance of HashChangeEvent.
727 728 729 730 731 |
# File 'lib/dommy/event.rb', line 727 def initialize(type, init = nil) super @old_url = read_init(init, "oldURL").to_s @new_url = read_init(init, "newURL").to_s end |
Instance Attribute Details
#new_url ⇒ Object (readonly)
Returns the value of attribute new_url.
725 726 727 |
# File 'lib/dommy/event.rb', line 725 def new_url @new_url end |
#old_url ⇒ Object (readonly)
Returns the value of attribute old_url.
725 726 727 |
# File 'lib/dommy/event.rb', line 725 def old_url @old_url end |
Instance Method Details
#__js_get__(key) ⇒ Object
733 734 735 736 737 738 739 |
# File 'lib/dommy/event.rb', line 733 def __js_get__(key) case key when "oldURL" then @old_url when "newURL" then @new_url else super end end |