diff --git a/docs/api/globalconfig.html b/docs/api/globalconfig.html index f2f0fd27..fcd8aa1a 100755 --- a/docs/api/globalconfig.html +++ b/docs/api/globalconfig.html @@ -92,7 +92,7 @@ $(document).bind("mobileinit", function(){
Since the dialog is a standard "page", it will open with the standard slide transition that's applied to all pages. And like all pages, you can specify any page transition you want on the dialog by adding the data-transition attribute to the link. To make it feel more dialog-like, we recommend specifying a transition of "pop", "slideup" or "flip".
By default, the dialog will open with a 'pop' transition. Like all pages, you can specify any page transition you want on the dialog by adding the data-transition attribute to the link. To make it feel more dialog-like, we recommend specifying a transition of "pop", "slideup" or "flip".
<a href="foo.html" data-rel="dialog" data-transition="pop">Open dialog</a>
diff --git a/experiments/scrollview/sv-test-01.html b/experiments/scrollview/sv-test-01.html
index e041e1fb..2ee6b5ac 100644
--- a/experiments/scrollview/sv-test-01.html
+++ b/experiments/scrollview/sv-test-01.html
@@ -120,7 +120,7 @@ $(function(){
-
+
diff --git a/js/jquery.mobile.listview.js b/js/jquery.mobile.listview.js
index 919cb925..0ceb6fd5 100644
--- a/js/jquery.mobile.listview.js
+++ b/js/jquery.mobile.listview.js
@@ -127,7 +127,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
item.find( "p, dl" ).addClass( "ui-li-desc" );
- item.find( "li" ).find( "img:eq(0)" ).addClass( "ui-li-thumb" ).each(function() {
+ $list.find( "li" ).find( "img:eq(0)" ).addClass( "ui-li-thumb" ).each(function() {
$( this ).closest( "li" )
.addClass( $(this).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );
});
diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js
index 95f55cdf..0f2f747e 100644
--- a/js/jquery.mobile.navigation.js
+++ b/js/jquery.mobile.navigation.js
@@ -135,13 +135,13 @@
isPageTransitioning = false,
//nonsense hash change key for dialogs, so they create a history entry
- dialogHashKey = "&ui-state=dialog";
+ dialogHashKey = "&ui-state=dialog",
//existing base tag?
- var $base = $head.children("base"),
- hostURL = location.protocol + '//' + location.host,
- docLocation = path.get( hostURL + location.pathname ),
- docBase = docLocation;
+ $base = $head.children("base"),
+ hostURL = location.protocol + '//' + location.host,
+ docLocation = path.get( hostURL + location.pathname ),
+ docBase = docLocation;
if ($base.length){
var href = $base.attr("href");
@@ -171,7 +171,7 @@
}
//base element management, defined depending on dynamic base tag support
- base = $.support.dynamicBaseTag ? {
+ var base = $.support.dynamicBaseTag ? {
//define base element, for use in routing asset urls that are referenced in Ajax-requested markup
element: ($base.length ? $base : $(" ", { href: docBase }).prependTo( $head )),
@@ -336,7 +336,7 @@
function defaultTransition(){
if(transition === undefined){
- transition = $.mobile.defaultTransition;
+ transition = ( nextPageRole && nextPageRole === 'dialog' ) ? 'pop' : $.mobile.defaultTransition;
}
}
@@ -517,12 +517,16 @@
//pre-parse html to check for a data-url,
//use it as the new fileUrl, base path, etc
var all = $(""),
- redirectLoc;
+ redirectLoc,
+ // TODO handle dialogs again
+ pageElemRegex = /.*(<[^>]*\bdata-role=["']?page["']?[^>]*>).*/,
+ dataUrlRegex = /\bdata-url=["']?([^"'>]*)["']?/;
- //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();
- redirectLoc = all.find('[data-url]').data('url');
+ // data-url must be provided for the base tag so resource requests can be directed to the
+ // correct url. loading into a temprorary element makes these requests immediately
+ if(pageElemRegex.test(html) && RegExp.$1 && dataUrlRegex.test(RegExp.$1) && RegExp.$1) {
+ redirectLoc = RegExp.$1;
+ }
if( redirectLoc ){
if(base){
@@ -536,6 +540,10 @@
}
}
+ //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();
+
//rewrite src and href attrs to use a base url
if( !$.support.dynamicBaseTag ){
var newPath = path.get( fileUrl );
diff --git a/tests/unit/listview/listview_core.js b/tests/unit/listview/listview_core.js
index 86d21feb..7063b679 100644
--- a/tests/unit/listview/listview_core.js
+++ b/tests/unit/listview/listview_core.js
@@ -207,4 +207,13 @@
start();
}, 1000);
});
+
+ test( "Refresh applys thumb styling", function(){
+ var ul = $('.ui-page-active ul');
+
+ ul.append("![]()
");
+ ok(!ul.find("#fiz img").hasClass("ui-li-thumb"));
+ ul.listview('refresh');
+ ok(ul.find("#fiz img").hasClass("ui-li-thumb"));
+ });
})(jQuery);
\ No newline at end of file
diff --git a/tests/unit/navigation/data-url.html b/tests/unit/navigation/data-url-tests/data-url.html
similarity index 100%
rename from tests/unit/navigation/data-url.html
rename to tests/unit/navigation/data-url-tests/data-url.html
diff --git a/tests/unit/navigation/data-url-tests/nested.html b/tests/unit/navigation/data-url-tests/nested.html
new file mode 100644
index 00000000..9c1b6348
--- /dev/null
+++ b/tests/unit/navigation/data-url-tests/nested.html
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/tests/unit/navigation/non-data-url.html b/tests/unit/navigation/data-url-tests/non-data-url.html
similarity index 100%
rename from tests/unit/navigation/non-data-url.html
rename to tests/unit/navigation/data-url-tests/non-data-url.html
diff --git a/tests/unit/navigation/data-url-tests/reverse-attr.html b/tests/unit/navigation/data-url-tests/reverse-attr.html
new file mode 100644
index 00000000..1074175a
--- /dev/null
+++ b/tests/unit/navigation/data-url-tests/reverse-attr.html
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/tests/unit/navigation/data-url-tests/single-quotes.html b/tests/unit/navigation/data-url-tests/single-quotes.html
new file mode 100644
index 00000000..63596923
--- /dev/null
+++ b/tests/unit/navigation/data-url-tests/single-quotes.html
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/tests/unit/navigation/index.html b/tests/unit/navigation/index.html
index 85625249..7870653c 100644
--- a/tests/unit/navigation/index.html
+++ b/tests/unit/navigation/index.html
@@ -80,11 +80,23 @@
+
+
+
+
+
+
@@ -97,5 +109,13 @@
+
+
+
+
+
+