* zin: add fade effect on load a new page

This commit is contained in:
Hao Sun
2023-04-11 10:22:32 +08:00
parent 75f39934de
commit a3d083d8a3
+4 -1
View File
@@ -96,6 +96,7 @@ function openApp(url, code, forceReload)
'<iframe',
'id="appIframe-' + code + '"',
'name="app-' + code + '"',
'class="fade"',
'allowfullscreen="true"',
'src="' + $.createLink('index', 'app', 'url=' + btoa(url)) + '"',
'frameborder="no"',
@@ -111,7 +112,9 @@ function openApp(url, code, forceReload)
iframe.onload = iframe.onreadystatechange = function(e)
{
openedApp.$app.removeClass('loading');
const finishLoad = () => $iframe.removeClass('loading').addClass('in');
iframe.contentWindow.$(iframe.contentDocument).one('pageload.app', finishLoad);
setTimeout(finishLoad, 10000);
triggerAppEvent(openedApp.code, 'loadapp', [openedApp, e]);
};
}