Skip to content

Commit 7066baf

Browse files
author
Gabriel Schulhof
committed
Navigation: Deprecate page events noting pagecontainer event differences
Fixes gh-245 Fixes gh-246 Fixes gh-251
1 parent 9bfe0bf commit 7066baf

10 files changed

+41
-38
lines changed

entries/pagebeforehide.xml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
<?xml version="1.0"?>
2-
<entry name="pagebeforehide" type="event" return="">
2+
<entry name="pagebeforehide" new-event-name="pagecontainerbeforehide" type="event" return="">
33
<title>pagebeforehide</title>
44
<desc>Triggered on the "fromPage" we are transitioning away from, before the actual transition animation is kicked off.</desc>
55
<longdesc>
6-
<p>Callbacks for this event will receive a data object as their 2nd arg. This data object has the following properties on it: </p>
7-
<ul>
8-
<li><code>nextPage</code> (object)
9-
<ul>
10-
<li>A jQuery collection object that contains the page DOM element that we are transitioning to.</li>
11-
</ul>
12-
</li>
13-
</ul>
14-
<p>Note that this event will not be dispatched during the transition of the first page at application startup since there is no previously active page.</p>
15-
6+
<xi:include href="../includes/pageevent-deprecation.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
167
</longdesc>
178
<added>1.0</added>
189
<signature>

entries/pagebeforeload.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<?xml version="1.0"?>
2-
<entry name="pagebeforeload" type="event" return="" deprecated="1.4.0">
2+
<entry name="pagebeforeload" new-event-name="pagecontainerbeforeload" type="event" return="" deprecated="1.4.0">
33
<title>pagebeforeload</title>
44
<desc>Triggered before any load request is made.</desc>
55
<longdesc>
6-
<strong>Note: The triggering of this event is deprecated as of jQuery Mobile 1.4.0. It will no longer be triggered in 1.5.0.</strong>
7-
<p>The replacement for <placeholder name="name"/> is <a href="/pagecontainer/#event-beforeload">pagecontainerbeforeload</a>. In jQuery Mobile 1.4.0, the two events are identical except for their name.</p>
6+
<xi:include href="../includes/pageevent-deprecation.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
87
</longdesc>
98
<added>1.0</added>
109
<signature>

entries/pagebeforeshow.xml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
<?xml version="1.0"?>
2-
<entry name="pagebeforeshow" type="event" return="">
2+
<entry name="pagebeforeshow" new-event-name="pagecontainerbeforeshow" type="event" return="">
33
<title>pagebeforeshow</title>
44
<desc>Triggered on the "toPage" we are transitioning to, before the actual transition animation is kicked off. </desc>
55
<longdesc>
6-
<p>Callbacks for this event will receive a data object as their 2nd arg. This data object has the following properties on it: </p>
7-
<ul>
8-
<li><code>prevPage</code> (object)
9-
<ul>
10-
<li>A jQuery collection object that contains the page DOM element that we are transitioning away from. Note that this collection is empty when the first page is transitioned in during application startup.</li>
11-
</ul>
12-
</li>
13-
</ul>
6+
<xi:include href="../includes/pageevent-deprecation.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
147
</longdesc>
158
<added>1.0</added>
169
<signature>

entries/pagechangefailed.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<?xml version="1.0"?>
2-
<entry name="pagechangefailed" type="event" return="" deprecated="1.4.0">
2+
<entry name="pagechangefailed" new-event-name="pagecontainerchangefailed" type="event" return="" deprecated="1.4.0">
33
<title>pagechangefailed</title>
44
<desc>Triggered when the changePage() request fails to load the page.</desc>
55
<longdesc>
6-
<strong>Note: The triggering of this event is deprecated as of jQuery Mobile 1.4.0. It will no longer be triggered in 1.5.0.</strong>
7-
<p>The replacement for <placeholder name="name"/> is <a href="/pagecontainer/#event-changefailed">pagecontainerchangefailed</a>. In jQuery Mobile 1.4.0, the two events are identical except for their name.</p>
6+
<xi:include href="../includes/pageevent-deprecation.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
87
</longdesc>
98
<added>1.0</added>
109
<signature>

entries/pagecontainer.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@
8282
</options>
8383

8484
<events>
85+
<event name="beforehide">
86+
<desc>Triggered before the actual transition animation is kicked off.</desc>
87+
<argument name="event" type="Event" />
88+
<argument name="ui" type="Object">
89+
<property name="nextPage">
90+
<desc>A jQuery collection object that contains the destination page DOM element.</desc>
91+
<type name="jQuery"/>
92+
</property>
93+
</argument>
94+
</event>
8595
<event name="beforeload">
8696
<desc>Triggered before any load request is made.
8797
<p>Callbacks bound to this event can call <code>preventDefault()</code> on the event to indicate that they are handling the load request. Callbacks that do this <strong>MUST</strong> make sure they call <code>resolve()</code> or <code>reject()</code> on the deferred object reference contained in the object passed to the callback via its <code>ui</code> parameter.</p>
@@ -145,6 +155,16 @@ $( document ).on( "pagecontainerbeforeload", function( event, data ) {
145155
</property>
146156
</argument>
147157
</event>
158+
<event name="beforeshow">
159+
<desc>Triggered before the actual transition animation is kicked off.</desc>
160+
<argument name="event" type="Event" />
161+
<argument name="ui" type="Object">
162+
<property name="prevPage">
163+
<desc>A jQuery collection object that contains the source page DOM element.</desc>
164+
<type name="jQuery"/>
165+
</property>
166+
</argument>
167+
</event>
148168
<event name="beforetransition">
149169
<desc>Triggered before the transition between two pages starts.</desc>
150170
<argument name="event" type="Event"/>

entries/pagehide.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<?xml version="1.0"?>
2-
<entry name="pagehide" type="event" return="" deprecated="1.4.0">
2+
<entry name="pagehide" new-event-name="pagecontainerhide" type="event" return="" deprecated="1.4.0">
33
<title>pagehide</title>
44
<desc>Triggered on the "fromPage" after the transition animation has completed.</desc>
55
<longdesc>
6-
<strong>Note: The triggering of this event is deprecated as of jQuery Mobile 1.4.0. It will no longer be triggered in 1.5.0.</strong>
7-
<p>The replacement for <placeholder name="name"/> is <a href="/pagecontainer/#event-hide">pagecontainerhide</a>. In jQuery Mobile 1.4.0, the two events are identical except for their name.</p>
6+
<xi:include href="../includes/pageevent-deprecation.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
87
</longdesc>
98
<added>1.0</added>
109
<signature>

entries/pageload.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<?xml version="1.0"?>
2-
<entry name="pageload" type="event" return="" deprecated="1.4.0">
2+
<entry name="pageload" new-event-name="pagecontainerload" type="event" return="" deprecated="1.4.0">
33
<title>pageload</title>
44
<desc>Triggered after the page is successfully loaded and inserted into the DOM.</desc>
55
<longdesc>
6-
<strong>Note: The triggering of this event is deprecated as of jQuery Mobile 1.4.0. It will no longer be triggered in 1.5.0.</strong>
7-
<p>The replacement for <placeholder name="name"/> is <a href="/pagecontainer/#event-load">pagecontainerload</a>. In jQuery Mobile 1.4.0, the two events are identical except for their name.</p>
6+
<xi:include href="../includes/pageevent-deprecation.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
87
</longdesc>
98
<added>1.0</added>
109
<signature>

entries/pageloadfailed.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<?xml version="1.0"?>
2-
<entry name="pageloadfailed" type="event" return="" deprecated="1.4.0">
2+
<entry name="pageloadfailed" new-event-name="pagecontainerloadfailed" type="event" return="" deprecated="1.4.0">
33
<title>pageloadfailed</title>
44
<desc>Triggered if the page load request failed.</desc>
55
<longdesc>
6-
<strong>Note: The triggering of this event is deprecated as of jQuery Mobile 1.4.0. It will no longer be triggered in 1.5.0.</strong>
7-
<p>The replacement for <placeholder name="name"/> is <a href="/pagecontainer/#event-load">pagecontainerloadfailed</a>. In jQuery Mobile 1.4.0, the two events are identical except for their name.</p>
6+
<xi:include href="../includes/pageevent-deprecation.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
87
</longdesc>
98
<added>1.0</added>
109
<signature>

entries/pageshow.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<?xml version="1.0"?>
2-
<entry name="pageshow" type="event" return="">
2+
<entry name="pageshow" new-event-name="pagecontainershow" type="event" return="">
33
<title>pageshow</title>
44
<desc>Triggered on the "toPage" after the transition animation has completed.</desc>
55
<longdesc>
6-
<strong>Note: The triggering of this event is deprecated as of jQuery Mobile 1.4.0. It will no longer be triggered in 1.5.0.</strong>
7-
<p>The replacement for <placeholder name="name"/> is <a href="/pagecontainer/#event-show">pagecontainershow</a>. In jQuery Mobile 1.4.0, the two events are identical except for their name.</p>
6+
<xi:include href="../includes/pageevent-deprecation.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
87
</longdesc>
98
<added>1.0</added>
109
<signature>

includes/pageevent-deprecation.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0"?>
2+
<div class="warning">
3+
<strong>Note: The triggering of this event is deprecated as of jQuery Mobile 1.4.0. It will no longer be triggered in 1.5.0.</strong>
4+
<p>The replacement for <code><placeholder name="name"/></code> is the <code><a href="/pagecontainer/">pagecontainer</a></code> widget's <code><placeholder name="new-event-name"/></code> event. In jQuery Mobile 1.4.0, the two events are identical except for their name and the fact that <code><placeholder name="new-event-name"/></code> is triggered on the pagecontainer, whereas <code><placeholder name="name"/></code> is triggered on the page.</p>
5+
</div>

0 commit comments

Comments
 (0)