Implemented and documented the tapToggleBlacklist option of the fixedtoolbar plugin, which tells the plugin to ignore certain targets for tap toggling the toolbars. The default list is "a, input, select, textarea, .ui-header-fixed, .ui-footer-fixed".

This commit is contained in:
scottjehl 2012-01-27 19:34:14 +07:00
parent 5ef03c8474
commit a2bfc27492
2 changed files with 12 additions and 1 deletions

View file

@ -84,6 +84,16 @@ $.mobile.fixedToolbars
</dd>
<dt><code>tapToggleBlacklist</code> <em>string</em></dt>
<dd>
<p class="default">default: "a, input, select, textarea, .ui-header-fixed, .ui-footer-fixed"</p>
<p>A list of jQuery selectors that should be ignored for tap-toggling the toolbars.</p>
<pre><code>$("[data-role=header]").fixedtoolbar(<strong>{ tapToggleBlacklist: "a, input, select, textarea, .ui-header-fixed, .ui-footer-fixed" }</strong>);</code></pre>
</dd>
<dt><code>updatePagePadding</code> <em>boolean</em></dt>
<dd>
<p class="default">default: true</p>

View file

@ -14,6 +14,7 @@ define( [ "jquery", "./jquery.mobile.widget", "./jquery.mobile.core", "./jquery.
transition: "slide", //can be none, fade, slide (slide maps to slideup or slidedown)
fullscreen: false,
tapToggle: true,
tapToggleBlacklist: "a, input, select, textarea, .ui-header-fixed, .ui-footer-fixed",
updatePagePadding: true,
// Browser detection! Weeee, here we go...
@ -225,7 +226,7 @@ define( [ "jquery", "./jquery.mobile.widget", "./jquery.mobile.core", "./jquery.
// tap toggle
$el.closest( ".ui-page" )
.bind( "vclick", function( e ){
if( o.tapToggle && $el.find( e.target ).length === 0 ){
if( o.tapToggle && !$( e.target ).closest( o.tapToggleBlacklist ).length ){
self.toggle();
}
});