From a22d627c0d9d8cf14db4e779ae331c42a5bd39d9 Mon Sep 17 00:00:00 2001 From: sunhao Date: Wed, 26 Jul 2023 16:37:18 +0800 Subject: [PATCH] * support to load zin page. --- module/index/js/index.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/module/index/js/index.js b/module/index/js/index.js index 78e30a1286..84cf35fe41 100644 --- a/module/index/js/index.js +++ b/module/index/js/index.js @@ -208,9 +208,14 @@ var iframe = app.$iframe[0]; if(iframe && iframe.contentDocument && iframe.contentWindow && iframe.contentWindow.$) { - var result = iframe.contentWindow.$(iframe.contentDocument).triggerHandler('openapp.apps', [app, url]); - if (result === false) { - return 'cancel'; + var $iframeDoc = iframe.contentWindow.$(iframe.contentDocument); + if ($iframeDoc.triggerHandler) + { + if ($iframeDoc.triggerHandler('openapp.apps', [app, url]) === false) return 'cancel'; + } + else if($iframeDoc.trigger) + { + $iframeDoc.trigger('openapp.apps'); } } } @@ -394,9 +399,14 @@ var iframe = app.$iframe[0]; if(iframe && iframe.contentDocument && iframe.contentWindow && iframe.contentWindow.$) { - var result = iframe.contentWindow.$(iframe.contentDocument).triggerHandler('closeapp.apps', [app]); - if (result === false) { - return 'cancel'; + var $iframeDoc = iframe.contentWindow.$(iframe.contentDocument); + if ($iframeDoc.triggerHandler) + { + if ($iframeDoc.triggerHandler('openapp.apps', [app]) === false) return 'cancel'; + } + else if($iframeDoc.trigger) + { + $iframeDoc.trigger('openapp.apps'); } } }