Skip to content

Commit 9384ae4

Browse files
committed
Merge pull request #55 from tindzk/ticket53
Add HashChangeEvent
2 parents 63b00a8 + 8a3099f commit 9384ae4

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

src/main/scala/org/scalajs/dom/Html.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1762,7 +1762,7 @@ class HTMLFrameSetElement extends HTMLElement {
17621762
var onoffline: js.Function1[Event, _] = ???
17631763
var border: String = ???
17641764
var onunload: js.Function1[Event, _] = ???
1765-
var onhashchange: js.Function1[Event, _] = ???
1765+
var onhashchange: js.Function1[HashChangeEvent, _] = ???
17661766
var onload: js.Function1[Event, _] = ???
17671767
var onbeforeunload: js.Function1[BeforeUnloadEvent, _] = ???
17681768
var onstorage: js.Function1[StorageEvent, _] = ???

src/main/scala/org/scalajs/dom/lib.scala

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,29 @@ trait ModifierKeyEvent extends js.Object {
11151115
def shiftKey: Boolean = ???
11161116
}
11171117

1118+
/**
1119+
* The hashchange event is fired when the fragment identifier of the URL has
1120+
* changed (the part of the URL that follows the # symbol, including the #
1121+
* symbol).
1122+
*
1123+
* MDN
1124+
*/
1125+
trait HashChangeEvent extends Event {
1126+
/**
1127+
* The new URL to which the window is navigating.
1128+
*
1129+
* MDN
1130+
*/
1131+
def newURL: String = ???
1132+
1133+
/**
1134+
* The previous URL from which the window was navigated.
1135+
*
1136+
* MDN
1137+
*/
1138+
def oldURL: String = ???
1139+
}
1140+
11181141
/**
11191142
* The DOM MouseEvent interface represents events that occur due to the user
11201143
* interacting with a pointing device (such as a mouse).
@@ -1871,7 +1894,7 @@ class Window extends EventTarget with WindowLocalStorage with WindowSessionStora
18711894
*
18721895
* MDN
18731896
*/
1874-
var onhashchange: js.Function1[Event, _] = ???
1897+
var onhashchange: js.Function1[HashChangeEvent, _] = ???
18751898
/**
18761899
* The unload event is raised when the window is unloading its content and resources.
18771900
* The resources removal is processed  after the unload event occurs.

0 commit comments

Comments
 (0)