This will allow JQM to remove dynamically injected pages from the DOM.
When dynamically injecting a page, inside pageContainer widget, the page to transition to is injected into the DOM, thus JQM will not fire an ajax request to fetch it. This will prevent _loadSuccess() from being called, which prevents _include() from being called, which sets the remove binding on the page being loaded.
Same as inside _include() the new page is enhanced first and then bound to.
fix #6656 pageContainer: dynamic injected pages missing remove bindings
After realizing that we have page option domCache, and that bindRemove() takes that into account, meaning that it does not perform any binding if domCache is turned on for the page, I am starting to think that perhaps this PR is acceptable.
My only concern is that making this change may result in bindRemove() being called multiple times on the same page. We should, maybe, add a flag to the page indicating that bindRemove() has already been called on it to make sure we don't attach pagehide.remove more than once for the same page.
@frequent wont this change cause internal page in a multi page document to also be removed?
@arschmitz : hm. some time ago. Need to delve into the code again.
This is pretty stale at this point so im going to close it. @frequent if you still would like to see this change lets talk on irc or move back to the issue about the best way to make this happen.