diff --git a/config/config.php b/config/config.php index 9cc796e468..e1df324fe9 100644 --- a/config/config.php +++ b/config/config.php @@ -40,6 +40,7 @@ $config->visions = ',rnd,lite,or,'; // 支持的界面类型。 /* ZIN 设置。 ZIN settings. */ $config->zin = new stdclass(); $config->clientCache = true; // 启用客户端缓存。 +$config->morphUpdate = true; // 平滑更新。 /* 支持的主题和语言。Supported themes and languages. */ $config->themes['default'] = 'default'; diff --git a/lib/base/front/front.class.php b/lib/base/front/front.class.php index 6f72aa7a53..25a5573595 100644 --- a/lib/base/front/front.class.php +++ b/lib/base/front/front.class.php @@ -1203,6 +1203,7 @@ EOT; $jsConfig->pingInterval = $config->pingInterval ?? ''; $jsConfig->onlybody = zget($_GET, 'onlybody', 'no'); $jsConfig->clientCache = $config->clientCache; + $jsConfig->morphUpdate = $config->morphUpdate; $jsConfig->account = isset($app->user->account) ? $app->user->account : ''; if($config->tabSession and helper::isWithTID()) $jsConfig->tid = zget($_GET, 'tid', ''); diff --git a/www/js/zui3/zin.js b/www/js/zui3/zin.js index 071d4fd795..e38e6c11ee 100644 --- a/www/js/zui3/zin.js +++ b/www/js/zui3/zin.js @@ -387,7 +387,7 @@ function renderWithHtml($target, html, selector, noMorph) { if(typeof selector === 'string') selector = parseSelector(selector); - if($target.hasClass('no-morph')) noMorph = true; + if(config.morphUpdate === false || $target.hasClass('no-morph')) noMorph = true; if(selector.inner) { if(noMorph) @@ -539,7 +539,7 @@ let cacheHit; const renderPageData = (data, onlyZinDebug) => { - const renderOptions = $.extend({noMorph: !options.partial && options.isDiffPage}, options); + const renderOptions = $.extend({noMorph: config.morphUpdate && !options.partial && options.isDiffPage}, options); if(!onlyZinDebug) updatePerfInfo(options, 'renderBegin'); renderPage(data.reduce((list, item, idx) => {