From 45098fc654ebd61cd7cdf97ad84dc7d9a851d233 Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 28 Sep 2020 08:51:46 -0600 Subject: [PATCH] Etemplate: fix for better behaviour if lazy-update pref is not set --- api/js/etemplate/et2_extension_nextmatch.js | 4 ++-- api/js/etemplate/et2_extension_nextmatch.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/js/etemplate/et2_extension_nextmatch.js b/api/js/etemplate/et2_extension_nextmatch.js index 4dca3c7ce9..8870408b1d 100644 --- a/api/js/etemplate/et2_extension_nextmatch.js +++ b/api/js/etemplate/et2_extension_nextmatch.js @@ -480,7 +480,7 @@ var et2_nextmatch = /** @class */ (function (_super) { return; } // Make some changes in what we're doing based on preference - var update_pref = egw.preference("lazy-update"); + var update_pref = egw.preference("lazy-update") || 'lazy'; if (_type == et2_nextmatch.UPDATE && !this.is_sorted_by_modified()) { _type = update_pref == "lazy" ? et2_nextmatch.UPDATE_IN_PLACE : et2_nextmatch.EDIT; } @@ -623,7 +623,7 @@ var et2_nextmatch = /** @class */ (function (_super) { et2_nextmatch.prototype.refresh_add = function (uid, type) { if (type === void 0) { type = et2_nextmatch.ADD; } var _a, _b; - var index = egw.preference("lazy-update") == "lazy" ? 0 : + var index = egw.preference("lazy-update") !== "exact" ? 0 : (this.is_sorted_by_modified() ? 0 : false); // No add, do a full refresh if (index === false) { diff --git a/api/js/etemplate/et2_extension_nextmatch.ts b/api/js/etemplate/et2_extension_nextmatch.ts index 364455e593..ec047d11c3 100644 --- a/api/js/etemplate/et2_extension_nextmatch.ts +++ b/api/js/etemplate/et2_extension_nextmatch.ts @@ -751,7 +751,7 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2 } // Make some changes in what we're doing based on preference - let update_pref = egw.preference("lazy-update"); + let update_pref = egw.preference("lazy-update") || 'lazy'; if(_type == et2_nextmatch.UPDATE && !this.is_sorted_by_modified()) { _type = update_pref == "lazy" ? et2_nextmatch.UPDATE_IN_PLACE : et2_nextmatch.EDIT; @@ -923,7 +923,7 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2 */ protected refresh_add(uid:string, type = et2_nextmatch.ADD) { - let index : boolean | number = egw.preference("lazy-update") == "lazy" ? 0 : + let index : boolean | number = egw.preference("lazy-update") !== "exact" ? 0 : (this.is_sorted_by_modified() ? 0 : false); // No add, do a full refresh