mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-19 12:01:06 +00:00
rearranged the places where overlays are first shown, and where the auto-hide timer is called
This commit is contained in:
parent
117cb3b78e
commit
ea63c773c6
2 changed files with 18 additions and 12 deletions
|
|
@ -12,11 +12,11 @@ $.fn.fixHeaderFooter = function(options){
|
|||
ignoreTargets: 'a,input,textarea,select,button,label,.ui-headfoot-placehold',
|
||||
transition: el.find('[data-headfoottransition]').attr('data-headfoottransition') || ['slidedown','slideup'],
|
||||
//also accepts a string, like 'fade'. All animations work, but fade and slidedown/up look best
|
||||
overlayOnly: el.find('.ui-fullscreen').length //if this is true, we should set the parent div to height 0 to force overlays...?
|
||||
overlayOnly: el.find('.ui-fullscreen').length
|
||||
},options);
|
||||
|
||||
var els = el.find('.ui-header,.ui-footer').wrap('<div class="ui-headfoot-placehold"><div class="ui-headfoot-wrap"></div></div>'),
|
||||
posLoop = setInterval(function(){ els.trigger('setTop'); }, 20),
|
||||
//posLoop = setInterval(function(){ els.trigger('setTop'); }, 20),
|
||||
tIsArray = $.isArray(o.transition);
|
||||
|
||||
//add transition types
|
||||
|
|
@ -123,11 +123,6 @@ $.fn.fixHeaderFooter = function(options){
|
|||
$(window)
|
||||
.bind('load',function(){
|
||||
els.trigger('overlayIn');
|
||||
|
||||
setTimeout(function(){
|
||||
els.trigger('overlayOut');
|
||||
if(posLoop){ clearInterval(posLoop); }
|
||||
}, 2000);
|
||||
|
||||
if(o.overlayOnly){
|
||||
//to-do...for a photo-viewer or something full-screen
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
orientation,
|
||||
backBtnText = "Back",
|
||||
prevUrl = location.hash,
|
||||
hashNavUnderway = false,
|
||||
//vars for custom event tracking
|
||||
scrolling = false,
|
||||
touching = false,
|
||||
|
|
@ -294,6 +295,7 @@
|
|||
//turn on/off page loading message.. also hides the ui-content div
|
||||
function pageLoading(done){
|
||||
if(done){
|
||||
hideToolbarsAfterDelay();
|
||||
//remove loading msg
|
||||
$html.removeClass('ui-loading');
|
||||
//fade in page content, remove loading msg
|
||||
|
|
@ -322,7 +324,8 @@
|
|||
to.animationComplete(function(){
|
||||
from.add(to).removeClass(' out in reverse '+ transitions);
|
||||
from.removeClass(activePageClass);
|
||||
pageLoading(true);
|
||||
to.find('.ui-header,.ui-footer').trigger('overlayIn');
|
||||
pageLoading(true);
|
||||
});
|
||||
if(back){ currentTransition = 'slide'; }
|
||||
};
|
||||
|
|
@ -338,6 +341,12 @@
|
|||
setTimeout(callback, transitionDuration);
|
||||
}
|
||||
};
|
||||
|
||||
function hideToolbarsAfterDelay(){
|
||||
setTimeout(function(){
|
||||
$('.ui-header,.ui-footer').trigger('overlayOut');
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
//markup-driven enhancements, to be called on any ui-page upon loading
|
||||
function mobilize($el){
|
||||
|
|
@ -399,11 +408,11 @@
|
|||
back = (url === prevUrl);
|
||||
|
||||
if(url){
|
||||
hashNavUnderway = true;
|
||||
//see if content is present - NOTE: local urls aren't working right now - need logic to kill #
|
||||
var localDiv = $('[id="'+url+'"]');
|
||||
if(localDiv.length){
|
||||
changePage($('.ui-page-active'), localDiv, back);
|
||||
pageLoading(true);
|
||||
}
|
||||
else { //ajax it in
|
||||
pageLoading();
|
||||
|
|
@ -414,7 +423,6 @@
|
|||
$(this).html( $(this).find('.ui-page:eq(0)').html() );
|
||||
mobilize($(this));
|
||||
changePage($('.ui-page-active'), $(this), back);
|
||||
pageLoading(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -429,8 +437,9 @@
|
|||
}
|
||||
else{
|
||||
startPage.addClass(activePageClass);
|
||||
startPage.find('.ui-header,.ui-footer').trigger('overlayIn');
|
||||
pageLoading(true);
|
||||
}
|
||||
pageLoading(true);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -458,12 +467,14 @@
|
|||
$body.bind('swiperight.jqm',function(){
|
||||
history.go(-1);
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
//some debug stuff for the events pages
|
||||
$('body').bind('scrollstart scrollstop swipe swipeleft swiperight tap taphold turn',function(e){
|
||||
$('#eventlogger').prepend('<div>Event fired: '+ e.type +'</div>');
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
})(jQuery, this);
|
||||
Loading…
Reference in a new issue