Merge branch 'master' of github.com:jquery/jquery-mobile

This commit is contained in:
Todd Parker 2010-10-15 12:33:27 -04:00
commit 49b3d79670
4 changed files with 492 additions and 521 deletions

File diff suppressed because one or more lines are too long

View file

@ -127,7 +127,7 @@
<p>You can seamlessly navigate between local, internal "pages" and external pages in jQuery Mobile. Both will look the same to the end user except that external pages will display the Ajax spinner while loading. In either situation, jQuery Mobile updates the page's URL hash to enable Back button support, deep-linking and bookmarking. </p>
<p>PLEASE NOTE: Since we are using the hash to track navigation history for all the Ajax 'pages', it's not currently possible to deep link to an anchor (index.html#foo) on a page in jQuery Mobile, because the framework will look for a 'page' with and ID of #foo instead of the native behavior of scrolling to the content with that ID.</p>
<p>PLEASE NOTE: Since we are using the hash to track navigation history for all the Ajax 'pages', it's not currently possible to deep link to an anchor (<code>index.html#foo</code>) on a page in jQuery Mobile, because the framework will look for a 'page' with and <code>ID</code> of <code>#foo</code> instead of the native behavior of scrolling to the content with that <code>ID</code>.</p>
<p>Learn more about the technical details of the navigation model and <a href="docs-navmodel.html">Ajax, hashes and history</a> in jQuery mobile.</p>

View file

@ -6,8 +6,8 @@
currentPage = $('.ui-page-active'),
menuPage = $( '<div data-role=\'dialog\' data-theme=\'a\'>' +
'<div data-role=\'header\' data-theme=\'b\'>' +
'<a href=\'#\' class=\'ui-btn-left\' data-icon=\'delete\'>Cancel</a>'+
'<div class=\'ui-title\'>Choose a theme:</div>'+
'<a href=\'#\' class=\'ui-btn-left\' data-icon=\'delete\' data-iconpos=\'notext\'>Cancel</a>'+
'<div class=\'ui-title\'>Switch Theme:</div>'+
'</div>'+
'<div data-role=\'content\' data-theme=\'c\'><ul data-role=\'listview\' data-inset=\'true\'></ul></div>'+
'</div>' )
@ -27,31 +27,25 @@
//remover, adder
function addTheme(theme){
/*
//way too greedy theme remover
$.each(themes,function( i ){
$('head link[href*='+themes[ i ]+']').remove();
});
*/
$('head').append( '<link rel=\'stylesheet\' href=\''+ themesDir + theme +'/\' />' );
}
//finished with this
function done(){
$.changePage(menuPage, currentPage, 'slideup', true);
$.changePage(menuPage, currentPage, 'pop', true);
menuPage.bind('pagehide',function(){
$(this).remove();
menuPage.remove();
});
return false;
}
//destroy
menuPage.find('.ui-btn-left').click(done);
//create page, listview
menuPage.page();
//change page now
$.changePage(currentPage, menuPage, 'slideup', false);
//destroy
menuPage.find('.ui-btn-left').click(done);
$.changePage(currentPage, menuPage, 'pop', false);
};
})(jQuery);

View file

@ -156,7 +156,6 @@
// transition between pages - based on transitions from jQtouch
function changePage( from, to, transition, back ) {
jQuery( document.activeElement ).blur();
window.scrollTo( 0, 0 );
//trigger before show/hide events
from.trigger("beforepagehide", {nextPage: to});
@ -166,7 +165,7 @@
pageLoading( true );
//trigger show/hide events, allow preventing focus change through return false
if( from.trigger("pagehide", {nextPage: to}) !== false && to.trigger("pageshow", {prevPage: from}) !== false ){
window.scrollTo(0,0);
hideBrowserChrome();
reFocus( to );
}
}