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) { ...@@ -1916,10 +1916,7 @@ var mui = (function(document, undefined) {
* @returns {Object} * @returns {Object}
*/ */
$.waitingOptions = function(options) { $.waitingOptions = function(options) {
return $.extend({ return $.extend(true,{},{autoShow: true,title: ''}, options);
autoShow: true,
title: ''
}, options);
}; };
/** /**
* 窗口显示配置 * 窗口显示配置
...@@ -2045,20 +2042,17 @@ var mui = (function(document, undefined) { ...@@ -2045,20 +2042,17 @@ var mui = (function(document, undefined) {
} }
options = options || {}; options = options || {};
var params = options.params || {}; var params = options.params || {};
var webview, nShow, nWaiting; var webview = null,webviewCache = null, nShow, nWaiting;
if ($.webviews[id]) { //已缓存
var webviewCache = $.webviews[id]; if($.webviews[id]){
webview = webviewCache.webview; webviewCache = $.webviews[id];
//需要处理用户手动关闭窗口的情况,此时webview应该是空的; //webview真实存在,才能获取
if (!webview || !webview.getURL()) { if(plus.webview.getWebviewById(id)){
//再次新建一个webview; webview = webviewCache.webview;
options = $.extend(options, {
id: id,
url: url,
preload: true
}, true);
webview = $.createWindow(options);
} }
}
if (webviewCache&&webview) { //已缓存
//每次show都需要传递动画参数; //每次show都需要传递动画参数;
//预加载的动画参数优先级:openWindow配置>preloadPages配置>mui默认配置; //预加载的动画参数优先级:openWindow配置>preloadPages配置>mui默认配置;
nShow = webviewCache.show; 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) { ...@@ -1916,10 +1916,7 @@ var mui = (function(document, undefined) {
* @returns {Object} * @returns {Object}
*/ */
$.waitingOptions = function(options) { $.waitingOptions = function(options) {
return $.extend({ return $.extend(true,{},{autoShow: true,title: ''}, options);
autoShow: true,
title: ''
}, options);
}; };
/** /**
* 窗口显示配置 * 窗口显示配置
...@@ -2045,20 +2042,17 @@ var mui = (function(document, undefined) { ...@@ -2045,20 +2042,17 @@ var mui = (function(document, undefined) {
} }
options = options || {}; options = options || {};
var params = options.params || {}; var params = options.params || {};
var webview, nShow, nWaiting; var webview = null,webviewCache = null, nShow, nWaiting;
if ($.webviews[id]) { //已缓存
var webviewCache = $.webviews[id]; if($.webviews[id]){
webview = webviewCache.webview; webviewCache = $.webviews[id];
//需要处理用户手动关闭窗口的情况,此时webview应该是空的; //webview真实存在,才能获取
if (!webview || !webview.getURL()) { if(plus.webview.getWebviewById(id)){
//再次新建一个webview; webview = webviewCache.webview;
options = $.extend(options, {
id: id,
url: url,
preload: true
}, true);
webview = $.createWindow(options);
} }
}
if (webviewCache&&webview) { //已缓存
//每次show都需要传递动画参数; //每次show都需要传递动画参数;
//预加载的动画参数优先级:openWindow配置>preloadPages配置>mui默认配置; //预加载的动画参数优先级:openWindow配置>preloadPages配置>mui默认配置;
nShow = webviewCache.show; 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 @@ ...@@ -36,10 +36,7 @@
* @returns {Object} * @returns {Object}
*/ */
$.waitingOptions = function(options) { $.waitingOptions = function(options) {
return $.extend({ return $.extend(true,{},{autoShow: true,title: ''}, options);
autoShow: true,
title: ''
}, options);
}; };
/** /**
* 窗口显示配置 * 窗口显示配置
...@@ -165,20 +162,17 @@ ...@@ -165,20 +162,17 @@
} }
options = options || {}; options = options || {};
var params = options.params || {}; var params = options.params || {};
var webview, nShow, nWaiting; var webview = null,webviewCache = null, nShow, nWaiting;
if ($.webviews[id]) { //已缓存
var webviewCache = $.webviews[id]; if($.webviews[id]){
webview = webviewCache.webview; webviewCache = $.webviews[id];
//需要处理用户手动关闭窗口的情况,此时webview应该是空的; //webview真实存在,才能获取
if (!webview || !webview.getURL()) { if(plus.webview.getWebviewById(id)){
//再次新建一个webview; webview = webviewCache.webview;
options = $.extend(options, {
id: id,
url: url,
preload: true
}, true);
webview = $.createWindow(options);
} }
}
if (webviewCache&&webview) { //已缓存
//每次show都需要传递动画参数; //每次show都需要传递动画参数;
//预加载的动画参数优先级:openWindow配置>preloadPages配置>mui默认配置; //预加载的动画参数优先级:openWindow配置>preloadPages配置>mui默认配置;
nShow = webviewCache.show; 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