Skip to content

Commit faf26d8

Browse files
author
scottjehl
committed
namespaced $.fixedToolbars to $.mobile. Kept a deprecated pointer to $.fixedToolbars that we'll want to remove later. This feature can now be documented. Addresses Issue jquery-archive#2024
1 parent f020f06 commit faf26d8

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

js/jquery.mobile.fixHeaderFooter.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $.fn.fixHeaderFooter = function( options ) {
2929
};
3030

3131
//single controller for all showing,hiding,toggling
32-
$.fixedToolbars = (function() {
32+
$.mobile.fixedToolbars = (function() {
3333

3434
if ( !$.support.scrollTop ) {
3535
return;
@@ -62,10 +62,10 @@ $.fixedToolbars = (function() {
6262
// callbacks for the plugin will fire off a show when the scrolling has stopped.
6363
if ( !autoHideMode && currentstate === "overlay" ) {
6464
if ( !delayTimer ) {
65-
$.fixedToolbars.hide( true );
65+
$.mobile.fixedToolbars.hide( true );
6666
}
6767

68-
$.fixedToolbars.startShowTimer();
68+
$.mobile.fixedToolbars.startShowTimer();
6969
}
7070
}
7171

@@ -87,7 +87,7 @@ $.fixedToolbars = (function() {
8787
}
8888

8989
if ( !scrollTriggered ) {
90-
$.fixedToolbars.toggle( stateBefore );
90+
$.mobile.fixedToolbars.toggle( stateBefore );
9191
stateBefore = null;
9292
}
9393
}
@@ -121,10 +121,10 @@ $.fixedToolbars = (function() {
121121
autoHideMode = isOverlayState || !!delayTimer;
122122

123123
if ( autoHideMode ) {
124-
$.fixedToolbars.clearShowTimer();
124+
$.mobile.fixedToolbars.clearShowTimer();
125125

126126
if ( isOverlayState ) {
127-
$.fixedToolbars.hide( true );
127+
$.mobile.fixedToolbars.hide( true );
128128
}
129129
}
130130
})
@@ -137,7 +137,7 @@ $.fixedToolbars = (function() {
137137
scrollTriggered = false;
138138

139139
if ( autoHideMode ) {
140-
$.fixedToolbars.startShowTimer();
140+
$.mobile.fixedToolbars.startShowTimer();
141141
autoHideMode = false;
142142
}
143143
stateBefore = null;
@@ -175,7 +175,7 @@ $.fixedToolbars = (function() {
175175
}, 500);
176176
}
177177

178-
$.fixedToolbars.show( true, this );
178+
$.mobile.fixedToolbars.show( true, this );
179179
});
180180

181181
//When a collapsiable is hidden or shown we need to trigger the fixed toolbar to reposition itself (#1635)
@@ -244,7 +244,7 @@ $.fixedToolbars = (function() {
244244

245245
show: function( immediately, page ) {
246246

247-
$.fixedToolbars.clearShowTimer();
247+
$.mobile.fixedToolbars.clearShowTimer();
248248

249249
currentstate = "overlay";
250250

@@ -314,13 +314,13 @@ $.fixedToolbars = (function() {
314314

315315
startShowTimer: function() {
316316

317-
$.fixedToolbars.clearShowTimer();
317+
$.mobile.fixedToolbars.clearShowTimer();
318318

319319
var args = $.makeArray(arguments);
320320

321321
delayTimer = setTimeout(function() {
322322
delayTimer = undefined;
323-
$.fixedToolbars.show.apply( null, args );
323+
$.mobile.fixedToolbars.show.apply( null, args );
324324
}, showDelay);
325325
},
326326

@@ -335,8 +335,8 @@ $.fixedToolbars = (function() {
335335
if ( from ) {
336336
currentstate = from;
337337
}
338-
return ( currentstate === "overlay" ) ? $.fixedToolbars.hide() :
339-
$.fixedToolbars.show();
338+
return ( currentstate === "overlay" ) ? $.mobile.fixedToolbars.hide() :
339+
$.mobile.fixedToolbars.show();
340340
},
341341

342342
setTouchToggleEnabled: function(enabled) {
@@ -345,6 +345,9 @@ $.fixedToolbars = (function() {
345345
};
346346
})();
347347

348+
// TODO - Deprecated namepace on $. Remove in a later release
349+
$.fixedToolbars = $.mobile.fixedToolbars;
350+
348351
//auto self-init widgets
349352
$( document ).bind( "pagecreate create", function( e ){
350353

0 commit comments

Comments
 (0)