deprecated data-back attribute on links in favor of data-direction="reverse". Updated docs and relevant demos.

This commit is contained in:
scottjehl 2011-01-23 18:12:46 -05:00
parent 9b57c46349
commit be8eb3d0c6
4 changed files with 7 additions and 4 deletions

View file

@ -37,7 +37,7 @@
<a href="transition-success.html" data-role="button" data-rel="dialog" data-transition="flip">flip</a>
</p>
<p>In addition, you can also force a "backwards" transition by specifying <code>data-back="true"</code> on your link.</p>
<p>In addition, you can also force a "backwards" transition by specifying <code>data-direction="reverse"</code> on your link. Note: (this was formerly <code>data-back="true"</code>, which will remain supported until 1.0)</p>
<div class="ui-body ui-body-e">
<p><strong>Transitions from <a href="http://www.jqtouch.com/">jQtouch</a></strong> (<em>with small modifications</em>): Built by David Kaneda and maintained by Jonathan Stark.</p>

View file

@ -20,7 +20,7 @@
<p>That was an animated page transition effect that we added with a <code>data-transition</code> attribute on the link.</p>
<p>Since it uses CSS transforms, this should be hardware accelerated on many mobile devices.</p>
<p>What do you think?</p>
<a href="docs-transitions.html" data-role="button" data-theme="b">I like it</a>
<a href="docs-transitions.html" data-role="button" data-theme="b" data-direction="reverse">I like it</a>
</div>
</div>

View file

@ -23,7 +23,7 @@ $.widget( "mobile.dialog", $.mobile.widget, {
return;
}
if( e.type == "click" && ( $(e.target).closest('[data-back]')[0] || this==$closeBtn[0] ) ){
if( e.type == "click" && this==$closeBtn[0] ){
self.close();
return false;
}

View file

@ -573,7 +573,10 @@
else {
//use ajax
var transition = $this.data( "transition" ),
reverse = $this.data( "back" );
direction = $this.data("direction"),
reverse = direction && direction == "reverse" ||
// deprecated - remove by 1.0
$this.data( "back" );
nextPageRole = $this.attr( "data-rel" );