diff --git a/docs/lists/lists-split-purchase.html b/docs/lists/lists-split-purchase.html index bae232f4..83f6afe8 100755 --- a/docs/lists/lists-split-purchase.html +++ b/docs/lists/lists-split-purchase.html @@ -16,15 +16,14 @@
-

Purchase album?

+

Purchase?

- +

This album costs $10.99 and includes 9 tracks.

Your download will begin immediately on your mobile device and all tracks will by added your your library next time you sync.

- Purchase album -
+ Purchase album No thanks
diff --git a/docs/pages/docs-dialogs.html b/docs/pages/docs-dialogs.html index f127ae2c..61e5cff1 100755 --- a/docs/pages/docs-dialogs.html +++ b/docs/pages/docs-dialogs.html @@ -28,11 +28,8 @@

- Open dialog (Ajax) + Open dialog -

To load the dialog as a completely new page instead of pulling it in via Ajax, add rel="external" attribute, just like any standard link. This is useful when linking from a multi-page template to a dialog that's not part of that HTML document. The dialog will by styled exactly like the Ajax version, but there won't be page transition.

- - Open dialog (rel=external)

Transitions

diff --git a/docs/pages/link-formats.html b/docs/pages/link-formats.html index 4430584f..3816f8a3 100755 --- a/docs/pages/link-formats.html +++ b/docs/pages/link-formats.html @@ -32,7 +32,7 @@
  • Links that will refresh the page
  • External domain
  • Link with rel="external"
  • -
  • link with [data-ajax="false"]
  • +
  • link with [data-ajax="false"]
  • Link with target="foo"
  • Email links
  • Basic email: mailto:jdoe@foo.com
  • diff --git a/docs/toolbars/bars-fixed.html b/docs/toolbars/bars-fixed.html index 19eda90c..bb4ab8a7 100755 --- a/docs/toolbars/bars-fixed.html +++ b/docs/toolbars/bars-fixed.html @@ -13,7 +13,7 @@
    -
    +

    Fixed toolbars

    Home
    @@ -32,96 +32,83 @@ -

    Here is some text to make the page very long

    +

    Some text to make the page very long

    Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

    Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

    + +

    And an inset list

    + + + +

    Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

    -

    And an inset list

    +

    Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

    - - -

    Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

    - -

    Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

    - -

    Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

    +
    + + +
    + +
    + + +
    + +
    + + +
    + + +
    + + +
    + + +
    +
    +
    +
    +
    +
    + + +

    A bit more text

    + +

    Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.

    -
    +

    Fixed Footer

    diff --git a/docs/toolbars/footer-persist-a.html b/docs/toolbars/footer-persist-a.html index a962c904..229d3472 100755 --- a/docs/toolbars/footer-persist-a.html +++ b/docs/toolbars/footer-persist-a.html @@ -20,7 +20,7 @@
    -

    This page is a demo of a persistent footer navigation bar. At the foot of the page, you'll see a persistent horizontal navigation bar. Click on any of the links, and you'll see the page content transition but the footer remain fixed: The footer sticks persistently even when transitioning to a new HTML page, because the footer on all four HTML pages has the same data-id attribute.

    +

    This page is a demo of a persistent footer navigation bar. At the foot of the page, you'll see a persistent horizontal navigation bar. Click on any of the links, and you'll see the page content transition but the footer remain fixed: The footer sticks persistently even when transitioning to a new HTML page, because the footer on all four HTML pages has the same data-id attribute. Note: If you'd like an active button in your navbar to remain active when you return to it again, add a class of ui-state-persist in addition to ui-btn-active

    @@ -67,7 +67,7 @@
    diff --git a/docs/toolbars/footer-persist-b.html b/docs/toolbars/footer-persist-b.html index 95193c9a..2bc38b4b 100755 --- a/docs/toolbars/footer-persist-b.html +++ b/docs/toolbars/footer-persist-b.html @@ -19,75 +19,77 @@
    - +
    @@ -96,7 +98,7 @@
    diff --git a/docs/toolbars/footer-persist-c.html b/docs/toolbars/footer-persist-c.html index fd6c959f..bf789015 100755 --- a/docs/toolbars/footer-persist-c.html +++ b/docs/toolbars/footer-persist-c.html @@ -20,59 +20,63 @@
    + +
  • +

    Redfin

    +

    Redfin listing updates for today

    +

    There are 3 updates for the home on your watchlist: 1 updated MLS listing and 2 homes under contract.

    +

    5:52AM

    +
  • +
  • Tuesday, October 5, 2010 3
  • +
  • +

    Angela Smith

    +

    Link Request

    +

    My name is Angela Smith, SEO Consultant. I've greatly enjoyed looking through your site and I was wondering if you'd be interested in providing a link

    +

    6:24AM

    +
  • +
  • +

    Mike Taylor

    +

    This weekend in Maine

    +

    Sounds good, let me check into our plans.

    +

    6:24AM

    +
  • +
    @@ -80,7 +84,7 @@
    diff --git a/js/jquery.mobile.fixHeaderFooter.js b/js/jquery.mobile.fixHeaderFooter.js index 97240cf9..10cd212b 100644 --- a/js/jquery.mobile.fixHeaderFooter.js +++ b/js/jquery.mobile.fixHeaderFooter.js @@ -104,34 +104,34 @@ $.fixedToolbars = (function(){ //before page is shown, check for duplicate footer $('.ui-page').live('pagebeforeshow', function(event, ui){ var page = $(event.target), - footer = page.find( ":jqmData(role='footer'):not(.ui-sticky-footer)" ), - id = footer.jqmData('id'); - stickyFooter = null; - if (id) - { - stickyFooter = $( ".ui-footer:jqmData(id='" + id + "').ui-sticky-footer" ); - if (stickyFooter.length == 0) { - // No sticky footer exists for this data-id. We'll use this - // footer as the sticky footer for the group and then create - // a placeholder footer for the page. - stickyFooter = footer; - footer = stickyFooter.clone(); // footer placeholder - stickyFooter.addClass('ui-sticky-footer').before(footer); - } - footer.addClass('ui-footer-duplicate'); - stickyFooter.appendTo($.mobile.pageContainer).css('top',0); - setTop(stickyFooter); + footer = page.find( ":jqmData(role='footer')" ), + id = footer.data('id'), + prevPage = ui.prevPage; + + prevFooter = prevPage && prevPage.find( ":jqmData(role='footer')" ); + var prevFooterMatches = prevFooter.jqmData( "id" ) === id; + + if( prevFooterMatches ){ + stickyFooter = footer; + setTop( stickyFooter.removeClass("fade").appendTo( $.mobile.pageContainer ) ); } }); //after page is shown, append footer to new page $('.ui-page').live('pageshow', function(event, ui){ - if( stickyFooter && stickyFooter.length ){ - stickyFooter.appendTo(event.target).css('top',0); - } - $.fixedToolbars.show(true, this); - }); + var $this = $(this); + if( stickyFooter && stickyFooter.length ){ + + setTimeout(function(){ + setTop( stickyFooter.appendTo( $this ) ); + stickyFooter = null; + },400); + } + + $.fixedToolbars.show(true, this); + }); + // element.getBoundingClientRect() is broken in iOS 3.2.1 on the iPad. The // coordinates inside of the rect it returns don't have the page scroll position diff --git a/js/jquery.mobile.navbar.js b/js/jquery.mobile.navbar.js index 391ff5f5..15b90f10 100755 --- a/js/jquery.mobile.navbar.js +++ b/js/jquery.mobile.navbar.js @@ -33,8 +33,8 @@ $.widget( "mobile.navbar", $.mobile.widget, { }); $navbar.delegate("a", "vclick",function(event){ - $navbtns.removeClass( "ui-btn-active" ); - $( this ).addClass( "ui-btn-active" ); + $navbtns.not( ".ui-state-persist" ).removeClass( $.mobile.activeBtnClass ); + $( this ).addClass( $.mobile.activeBtnClass ); }); } }); diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index 159cd1e9..bbf3dc92 100644 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -105,13 +105,13 @@ }, // addNew is used whenever a new page is added - addNew: function( url, transition ){ + addNew: function( url, transition, storedTo ){ //if there's forward history, wipe it if( urlHistory.getNext() ){ urlHistory.clearForward(); } - urlHistory.stack.push( {url : url, transition: transition } ); + urlHistory.stack.push( {url : url, transition: transition, page: storedTo } ); urlHistory.activeIndex = urlHistory.stack.length - 1; }, @@ -402,7 +402,7 @@ //add page to history stack if it's not back or forward if( !back && !forward ){ - urlHistory.addNew( url, transition ); + urlHistory.addNew( url, transition, to ); } removeActiveLinkClass(); @@ -764,20 +764,29 @@ return; } - // special case for dialogs requires heading back or forward until we find a non dialog page + // special case for dialogs if( urlHistory.stack.length > 1 && - to.indexOf( dialogHashKey ) > -1 && - !$.mobile.activePage.is( ".ui-dialog" ) ){ + to.indexOf( dialogHashKey ) > -1 ){ - //determine if we're heading forward or backward and continue accordingly past - //the current dialog - urlHistory.directHashChange({ - currentUrl: to, - isBack: function(){ window.history.back(); }, - isForward: function(){ window.history.forward(); } - }); + // If current active page is not a dialog skip the dialog and continue + // in the same direction + if(!$.mobile.activePage.is( ".ui-dialog" )) { + //determine if we're heading forward or backward and continue accordingly past + //the current dialog + urlHistory.directHashChange({ + currentUrl: to, + isBack: function(){ window.history.back(); }, + isForward: function(){ window.history.forward(); } + }); - return; + // prevent changepage + return; + } else { + var setTo = function(){ to = $.mobile.urlHistory.getActive().page; }; + // if the current active page is a dialog and we're navigating + // to a dialog use the dialog objected saved in the stack + urlHistory.directHashChange({ currentUrl: to, isBack: setTo, isForward: setTo }); + } } //if to is defined, load it diff --git a/tests/unit/navigation/index.html b/tests/unit/navigation/index.html index 6c0649fd..98410f6a 100644 --- a/tests/unit/navigation/index.html +++ b/tests/unit/navigation/index.html @@ -130,5 +130,20 @@ + +
    +
    + Dialog +
    +
    + +
    +
    + Dialog 2 +
    +
    + +
    +
    diff --git a/tests/unit/navigation/navigation_core.js b/tests/unit/navigation/navigation_core.js index 2832e471..d7d32021 100644 --- a/tests/unit/navigation/navigation_core.js +++ b/tests/unit/navigation/navigation_core.js @@ -295,5 +295,27 @@ start(); }], 1000); }); + + asyncTest( "going back from a dialog triggered from a dialog should result in the first dialog ", function(){ + $.mobile.urlHistory.activeIndex = 0; + $.mobile.urlHistory.stack = []; + $.testHelper.openPage("#nested-dialog-page"); + + $.testHelper.sequence([ + // transition to the dialog + function(){ $("#nested-dialog-page a").click(); }, + + // transition to the second dialog + function(){ $("#nested-dialog-first a").click(); }, + + // transition to back to the first dialog + function(){ window.history.back(); }, + + // make sure we're on first dialog + function(){ + same($(".ui-page-active")[0], $("#nested-dialog-first")[0], "should be the first dialog"); + start(); + }], 1000); + }); })(jQuery); diff --git a/themes/default/jquery.mobile.theme.css b/themes/default/jquery.mobile.theme.css index fecf2da7..c8c07b05 100755 --- a/themes/default/jquery.mobile.theme.css +++ b/themes/default/jquery.mobile.theme.css @@ -77,7 +77,6 @@ font-weight: bold; color: #fff; text-shadow: 0 -1px 1px #000; - text-decoration: none; background-image: -moz-linear-gradient(top, #555555, #333333); @@ -95,7 +94,6 @@ font-weight: bold; color: #fff; text-shadow: 0 -1px 1px #000; - text-decoration: none; background-image: -moz-linear-gradient(top, #666666, #444444); @@ -128,6 +126,7 @@ .ui-btn-hover-a, .ui-btn-down-a { font-family: Helvetica, Arial, sans-serif; + text-decoration: none; } @@ -197,7 +196,6 @@ font-weight: bold; color: #fff; text-shadow: 0 -1px 1px #145072; - text-decoration: none; background-image: -moz-linear-gradient(top, #4e89c5, #2567ab); @@ -218,7 +216,6 @@ background-image: -moz-linear-gradient(top, #72b0d4, #4b88b6); - text-decoration: none; background-image: -webkit-gradient(linear,left top,left bottom, color-stop(0, #72b0d4), color-stop(1, #4b88b6)); @@ -248,6 +245,7 @@ .ui-btn-hover-b, .ui-btn-down-b { font-family: Helvetica, Arial, sans-serif; + text-decoration: none; } @@ -309,7 +307,6 @@ font-weight: bold; color: #444; text-shadow: 0 1px 1px #f6f6f6; - text-decoration: none; background-image: -moz-linear-gradient(top, #fefefe, #eeeeee); @@ -327,7 +324,6 @@ background: #dadada; font-weight: bold; color: #101010; - text-decoration: none; text-shadow: 0 1px 1px #fff; background-image: -moz-linear-gradient(top, #ededed, @@ -361,6 +357,7 @@ .ui-btn-hover-c, .ui-btn-down-c { font-family: Helvetica, Arial, sans-serif; + text-decoration: none; } @@ -419,7 +416,6 @@ background: #fff; font-weight: bold; color: #444; - text-decoration: none; text-shadow: 0 1px 1px #fff; } .ui-btn-up-d a.ui-link-inherit { @@ -432,7 +428,6 @@ color: #222; cursor: pointer; text-shadow: 0 1px 1px #fff; - text-decoration: none; background-image: -moz-linear-gradient(top, #fdfdfd, #eeeeee); @@ -476,6 +471,7 @@ .ui-btn-hover-d, .ui-btn-down-d { font-family: Helvetica, Arial, sans-serif; + text-decoration: none; } @@ -542,7 +538,6 @@ font-weight: bold; color: #333; text-shadow: 0 1px 1px #fe3; - text-decoration: none; text-shadow: 0 1px 0 #fff; background-image: -moz-linear-gradient(top, #fceda7, @@ -560,7 +555,6 @@ background: #fbe26f; font-weight: bold; color: #111; - text-decoration: none; text-shadow: 0 1px 1px #fff; background-image: -moz-linear-gradient(top, #fcf0b5, @@ -595,6 +589,7 @@ .ui-btn-hover-e, .ui-btn-down-e { font-family: Helvetica, Arial, sans-serif; + text-decoration: none; }