Skip to content
This repository

Add new pageremove event #2537

Closed
kurteknikk opened this Issue September 26, 2011 · 6 comments

3 participants

Kurt Kin Blas Todd Parker
Kurt

Hi,

The page events: pagebeforeshow, pageshow, pagebeforehide, pagehide are very usefull in most cases but i think there's a missing event when you compare the pagecreate event with the above...

Because there's no pageremove event, which i think should be triggered when a page is removed from the dom.

The reason being that first of all i think it will be more logical, and secondly my use case is that i need to update the page contents even when its hidden if its still in the dom, so when i remove the page from the dom i want to have some extra logic to clear some stuff.

Todd Parker

Can you add this to the feature request wiki and close when done? Thanks!

Kin Blas

@kurteknikk

Yeah, makes a lot of sense!

Kurt

Added to the feature request wiki, thanks :)

Kurt kurteknikk closed this September 26, 2011
Kurt kurteknikk reopened this September 28, 2011
Kurt

Sorry there was a misunderstanding, i closed the issue after i added it to the feature request wiki, i should have closed it when the issue is solved...

Todd Parker

Normally, we'd close issues once added to the feature request wiki page, but it sounds like @jblas is thinking about adding this now.

Kurt

Ok thanks for the info, also i agree with @jblas that its very important to be added before the first RC is released.

Kin Blas jblas closed this issue from a commit September 28, 2011
Kin Blas Fixes #2537 - Add new pageremove event
- Modified the pagehide callback in $.mobile._bindPageRemove() so that it fires off a "pageremove" event. Callbacks can prevent the removal of the page by simply calling preventDefault() on the pagremove event object that is passed to their callback.
34fb7b2
Kin Blas jblas closed this in 34fb7b2 September 28, 2011
Kin Blas jblas referenced this issue from a commit September 28, 2011
Kin Blas Added unit test for issue #2537 - Add new pageremove event.
The test makes use of a pageremove callback that conditionally calls preventDefault() on the event so that the test can make sure a developer can prevent a specific page from being removed from the DOM.
880df5f
Timmy Willison timmywil referenced this issue from a commit September 28, 2011
Kin Blas Fixes #2537 - Add new pageremove event
- Modified the pagehide callback in $.mobile._bindPageRemove() so that it fires off a "pageremove" event. Callbacks can prevent the removal of the page by simply calling preventDefault() on the pagremove event object that is passed to their callback.
f7ab8bc
Timmy Willison timmywil referenced this issue from a commit September 28, 2011
Kin Blas Added unit test for issue #2537 - Add new pageremove event.
The test makes use of a pageremove callback that conditionally calls preventDefault() on the event so that the test can make sure a developer can prevent a specific page from being removed from the DOM.
a50d3fd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.