* zin: fix loading old page is too slow in first time.

This commit is contained in:
sunhao
2023-07-04 12:21:12 +08:00
parent 5cf18a1e12
commit a3256834d0
2 changed files with 11 additions and 3 deletions
+2 -2
View File
File diff suppressed because one or more lines are too long
+9 -1
View File
@@ -477,7 +477,15 @@
let $page = $('#oldPage');
if(!$page.length)
{
$page = $('<div/>').append($('<iframe />').attr({name: `app-${currentCode}-old`, frameborder: 'no', allowtransparency: true, scrolling: 'auto', style: 'width:100%;height:100%;'})).attr({id: 'oldPage', class: 'load-indicator', style: 'position:fixed;width:100%;height:100%;left:0;top:0;z-index:100'}).insertAfter('body');
$page = $('<div/>')
.append($('<iframe />').attr({name: `app-${currentCode}-old`, frameborder: 'no', allowtransparency: true, scrolling: 'auto', style: 'width:100%;height:100%;'}))
.attr({id: 'oldPage', class: 'load-indicator', style: 'position:fixed;width:100%;height:100%;left:0;top:0;z-index:100'})
.insertAfter('body')
.on('oldPageLoad.app', () =>
{
$page.removeClass('loading').find('iframe').addClass('in');
$(document).trigger('pageload.app');
});
}
if($page.hasClass('hidden')) $page.addClass('loading').removeClass('hidden');
const $iframe = $page.find('iframe').removeClass('in');