* [misc] support to turn off morph update.

This commit is contained in:
sunhao
2024-07-19 19:19:34 +08:00
committed by 刘刚
parent 80d64f6e91
commit a8745ccd39
3 changed files with 4 additions and 2 deletions
+1
View File
@@ -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';
+1
View File
@@ -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', '');
+2 -2
View File
@@ -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) =>
{