Commit 37905123 authored by hbcui1984's avatar hbcui1984

解决手动关闭预加载页面后,再次打开时不显示waiting框的bug

http://ask.dcloud.net.cn/question/1942
parent dce8b1d7
......@@ -1916,10 +1916,7 @@ var mui = (function(document, undefined) {
* @returns {Object}
*/
$.waitingOptions = function(options) {
return $.extend({
autoShow: true,
title: ''
}, options);
return $.extend(true,{},{autoShow: true,title: ''}, options);
};
/**
* 窗口显示配置
......@@ -2045,20 +2042,17 @@ var mui = (function(document, undefined) {
}
options = options || {};
var params = options.params || {};
var webview, nShow, nWaiting;
if ($.webviews[id]) { //已缓存
var webviewCache = $.webviews[id];
webview = webviewCache.webview;
//需要处理用户手动关闭窗口的情况,此时webview应该是空的;
if (!webview || !webview.getURL()) {
//再次新建一个webview;
options = $.extend(options, {
id: id,
url: url,
preload: true
}, true);
webview = $.createWindow(options);
var webview = null,webviewCache = null, nShow, nWaiting;
if($.webviews[id]){
webviewCache = $.webviews[id];
//webview真实存在,才能获取
if(plus.webview.getWebviewById(id)){
webview = webviewCache.webview;
}
}
if (webviewCache&&webview) { //已缓存
//每次show都需要传递动画参数;
//预加载的动画参数优先级:openWindow配置>preloadPages配置>mui默认配置;
nShow = webviewCache.show;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1916,10 +1916,7 @@ var mui = (function(document, undefined) {
* @returns {Object}
*/
$.waitingOptions = function(options) {
return $.extend({
autoShow: true,
title: ''
}, options);
return $.extend(true,{},{autoShow: true,title: ''}, options);
};
/**
* 窗口显示配置
......@@ -2045,20 +2042,17 @@ var mui = (function(document, undefined) {
}
options = options || {};
var params = options.params || {};
var webview, nShow, nWaiting;
if ($.webviews[id]) { //已缓存
var webviewCache = $.webviews[id];
webview = webviewCache.webview;
//需要处理用户手动关闭窗口的情况,此时webview应该是空的;
if (!webview || !webview.getURL()) {
//再次新建一个webview;
options = $.extend(options, {
id: id,
url: url,
preload: true
}, true);
webview = $.createWindow(options);
var webview = null,webviewCache = null, nShow, nWaiting;
if($.webviews[id]){
webviewCache = $.webviews[id];
//webview真实存在,才能获取
if(plus.webview.getWebviewById(id)){
webview = webviewCache.webview;
}
}
if (webviewCache&&webview) { //已缓存
//每次show都需要传递动画参数;
//预加载的动画参数优先级:openWindow配置>preloadPages配置>mui默认配置;
nShow = webviewCache.show;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -36,10 +36,7 @@
* @returns {Object}
*/
$.waitingOptions = function(options) {
return $.extend({
autoShow: true,
title: ''
}, options);
return $.extend(true,{},{autoShow: true,title: ''}, options);
};
/**
* 窗口显示配置
......@@ -165,20 +162,17 @@
}
options = options || {};
var params = options.params || {};
var webview, nShow, nWaiting;
if ($.webviews[id]) { //已缓存
var webviewCache = $.webviews[id];
webview = webviewCache.webview;
//需要处理用户手动关闭窗口的情况,此时webview应该是空的;
if (!webview || !webview.getURL()) {
//再次新建一个webview;
options = $.extend(options, {
id: id,
url: url,
preload: true
}, true);
webview = $.createWindow(options);
var webview = null,webviewCache = null, nShow, nWaiting;
if($.webviews[id]){
webviewCache = $.webviews[id];
//webview真实存在,才能获取
if(plus.webview.getWebviewById(id)){
webview = webviewCache.webview;
}
}
if (webviewCache&&webview) { //已缓存
//每次show都需要传递动画参数;
//预加载的动画参数优先级:openWindow配置>preloadPages配置>mui默认配置;
nShow = webviewCache.show;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment