diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index 81c711ed081..63b2366596e 100644 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -223,11 +223,6 @@ } removeActiveLinkClass(); - //if there's a duplicateCachedPage, remove it from the DOM now that it's hidden - if( duplicateCachedPage != null ){ - duplicateCachedPage.remove(); - } - //jump to top or prev scroll, if set $.mobile.silentScroll( to.data( 'lastScroll' ) ); @@ -236,6 +231,11 @@ if( to.data("page")._trigger("show", null, {prevPage: from}) !== false ){ $.mobile.activePage = to; } + + //if there's a duplicateCachedPage, remove it from the DOM now that it's hidden + if (duplicateCachedPage != null) { + duplicateCachedPage.remove(); + } }; function addContainerClass(className){ @@ -324,14 +324,32 @@ $.mobile.pageLoading(); + // json-ptach + json = fileUrl.indexOf('mode=json'); + if (json != -1) { + dType = 'json'; + } else { + dType = 'text'; + } + // json-patch END + $.ajax({ url: fileUrl, type: type, data: data, + dataType: dType, // json-patch success: function( html ) { if(base){ base.set(fileUrl); } var all = $("
"); + // json-patch + if (json != -1) { + var myHtml; + var jTemp = html.template; + myHtml = $.tmpl($("#" + jTemp).html(), html); + html = $('
').append(myHtml).html(); + } + // json-patch END //workaround to allow scripts to execute when included in page divs all.get(0).innerHTML = html; to = all.find('[data-role="page"], [data-role="dialog"]').first(); @@ -380,7 +398,7 @@ /* Event Bindings - hashchange, submit, and click */ //bind to form submit events, handle with Ajax - $('form').live('submit', function(event){ + $("form[data-ajax!='false']").live('submit', function(event){ if( !$.mobile.ajaxFormsEnabled ){ return; } var type = $(this).attr("method"), @@ -495,4 +513,4 @@ } } }); -})( jQuery ); \ No newline at end of file +})( jQuery ); diff --git a/themes/default/jquery.mobile.theme.css b/themes/default/jquery.mobile.theme.css old mode 100755 new mode 100644 index 8d2423be17b..3a493a80840 --- a/themes/default/jquery.mobile.theme.css +++ b/themes/default/jquery.mobile.theme.css @@ -194,7 +194,7 @@ a.ui-link-inherit { text-decoration: none !important; } .ui-icon-radio-off { background-image: url(images/form-radio-off.png);} .ui-icon-radio-on { background-image: url(images/form-radio-on.png); } -.ui-icon-search { background-image: url(images/icon-search-black.png); background-size: 16px 16px; } +.ui-icon-search { background-image: url(images/icon-search-black.png); background-size: 16px 16px; background-repeat: no-repeat; background-position: 10px 10px;} /* loading icon */ .ui-icon-loading { background-image: url(images/ajax-loader.png); width: 40px; height: 40px; -moz-border-radius: 20px; -webkit-border-radius: 20px; border-radius: 20px; background-size: 35px 35px; }