Skip to content

Fix #354: Add PageTransitionEvent and corresponding event handler properties. #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions src/main/scala/org/scalajs/dom/raw/lib.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2587,6 +2587,29 @@ class Window
*/
var onpopstate: js.Function1[PopStateEvent, _] = js.native

/**
* An event handler property for pagehide events, which are fired when the browser hides
* the current page in the process of presenting a different page from the session's history.
*
* For example, when the user clicks the browser's Back button, the current page receives a
* pagehide event before the previous page is shown.
*
* MDN
*/
var onpagehide: js.Function1[PageTransitionEvent, _] = js.native

/**
* An event handler property for pageshow events, which are fired when the browser makes the
* window's document visible due to navigation tasks. This includes the process of initially
* loading the page, navigating to the page from another page within the same window or tab,
* or returning to the page using the browser's forward or back buttons.
*
* When this event is sent during the page load process, it's sent after the load event.
*
* MDN
*/
var onpageshow: js.Function1[PageTransitionEvent, _] = js.native

/**
* Returns a new MediaQueryList object representing the parsed results of the
* specified media query string.
Expand Down Expand Up @@ -7805,6 +7828,24 @@ trait PopStateEvent extends Event {
cancelableArg: Boolean, stateArg: js.Any): Unit = js.native
}

/**
* The PageTransitionEvent is fired when a document is being loaded or unloaded.
*
* This interface also inherits properties from its parent, Event.
*
* MDN
*/
@js.native
trait PageTransitionEvent extends Event {

/**
* Indicates if the document is loading from a cache.
*
* MDN
*/
def persisted: Boolean = js.native
}

@js.native
trait DOMSettableTokenList extends DOMTokenList {
def value: String = js.native
Expand Down