mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-19 12:01:06 +00:00
fixed a regression in safari where images wouldn't load properly because base was being set after html was appended.
This commit is contained in:
parent
5d5336d8b0
commit
3df24fab6d
1 changed files with 11 additions and 10 deletions
|
|
@ -458,14 +458,9 @@
|
|||
data: data,
|
||||
success: function( html ) {
|
||||
|
||||
|
||||
var all = $("<div></div>");
|
||||
//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();
|
||||
|
||||
//if page arrives with a data-url, use it as the new fileUrl, base path, etc
|
||||
var redirectLoc = to.data( "url" );
|
||||
//pre-parse html to check for a data-url,
|
||||
//use it as the new fileUrl, base path, etc
|
||||
var redirectLoc = / data-url="(.*)"/.test( html ) && RegExp.$1;
|
||||
|
||||
if( redirectLoc ){
|
||||
if(base){
|
||||
|
|
@ -477,8 +472,12 @@
|
|||
if(base){
|
||||
base.set(fileUrl);
|
||||
}
|
||||
to.attr( "data-url", fileUrl );
|
||||
}
|
||||
|
||||
var all = $("<div></div>");
|
||||
//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 ){
|
||||
|
|
@ -497,7 +496,9 @@
|
|||
}
|
||||
|
||||
//append to page and enhance
|
||||
to.appendTo( $.mobile.pageContainer );
|
||||
to
|
||||
.attr( "data-url", fileUrl )
|
||||
.appendTo( $.mobile.pageContainer );
|
||||
|
||||
enhancePage();
|
||||
transitionPages();
|
||||
|
|
|
|||
Loading…
Reference in a new issue