From 76591f3de1bc33a7daa4c6cbc4445fd90b6dc324 Mon Sep 17 00:00:00 2001 From: sunhao Date: Mon, 12 May 2025 13:32:46 +0800 Subject: [PATCH] * [bug #62387] fix error on change lang. --- www/js/zui3/zin.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/www/js/zui3/zin.js b/www/js/zui3/zin.js index f6cb46c1d4..a556c681f1 100644 --- a/www/js/zui3/zin.js +++ b/www/js/zui3/zin.js @@ -140,11 +140,7 @@ changeAppsLang: changeAppLang, changeAppsTheme: changeAppTheme, updateUserToolbar: function(){loadPage({selector: '#toolbar', partial: true, target: '#toolbar'})}, - triggerEvent: function(event, args, options) - { - if(!isInAppTab) return; - $.apps.triggerAppEvent(currentCode, event, [getPageInfo(), args], options); - } + triggerEvent: triggerEvent, }, parent.window.$.apps); const renderMap = @@ -277,6 +273,12 @@ triggerPerfEvent(stage); } + function triggerEvent(event, args, options) + { + if(!isInAppTab ||!$.apps.triggerAppEvent) return; + $.apps.triggerAppEvent(currentCode, event, [getPageInfo(), args], options); + } + function showZinDebugInfo(data, options) { if(!DEBUG) return; @@ -428,7 +430,7 @@ function afterUpdate($target, info, options) { if(window.afterPageUpdate) window.afterPageUpdate($target, info, options); - $.apps.triggerEvent('updatepart.app', {target: $target, info, options}, {silent: true}); + triggerEvent('updatepart.app', {target: $target, info, options}, {silent: true}); } function renderWithHtml($target, html, selector, noMorph) @@ -529,7 +531,7 @@ $('html').enableScroll(); } if(window.afterPageRender) window.afterPageRender(list, options); - $.apps.triggerEvent('updatepage.app', {updateFullPage: updateFullPage, options}); + triggerEvent('updatepage.app', {updateFullPage: updateFullPage, options}); if(!options.partial) { const newState = $.apps.updateApp(currentCode, currentAppUrl, document.title);