From 7752fe03defee3c20734ca4441103ea17b951b59 Mon Sep 17 00:00:00 2001 From: nathangray Date: Sat, 8 Aug 2020 10:51:39 -0600 Subject: [PATCH] Fix some nextmatch bugs - Removed rows could still have jQuery actions bound, resulting in errors - Focused row was not cleared if it was removed, resulting in errors - Fixed double get_rows call on refresh(..., update) --- api/js/egw_action/egw_action_popup.js | 3 ++- api/js/etemplate/et2_dataview_controller_selection.js | 5 +++++ api/js/etemplate/et2_dataview_controller_selection.ts | 6 ++++++ api/js/etemplate/et2_extension_nextmatch.js | 5 ----- api/js/etemplate/et2_extension_nextmatch.ts | 7 ------- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/api/js/egw_action/egw_action_popup.js b/api/js/egw_action/egw_action_popup.js index 1c9fc01fff..c29f6777fa 100644 --- a/api/js/egw_action/egw_action_popup.js +++ b/api/js/egw_action/egw_action_popup.js @@ -340,7 +340,8 @@ function egwPopupActionImplementation() ai.doUnregisterAction = function(_aoi) { - // + var node = _aoi.getDOMNode(); + jQuery(node).off(); }; /** diff --git a/api/js/etemplate/et2_dataview_controller_selection.js b/api/js/etemplate/et2_dataview_controller_selection.js index 0fd2fd7639..8b231f6f32 100644 --- a/api/js/etemplate/et2_dataview_controller_selection.js +++ b/api/js/etemplate/et2_dataview_controller_selection.js @@ -133,6 +133,11 @@ var et2_dataview_selectionManager = /** @class */ (function () { if (typeof this._registeredRows[_uid] !== "undefined" && this._registeredRows[_uid].tr === _tr) { this._inUpdate = true; + // Don't leave focusedEntry + // @ts-ignore + if (this._focusedEntry !== null && this._focusedEntry.uid == _uid) { + this.setFocused(_uid, false); + } this._registeredRows[_uid].tr = null; this._registeredRows[_uid].aoi = null; // Remove the action object from its container diff --git a/api/js/etemplate/et2_dataview_controller_selection.ts b/api/js/etemplate/et2_dataview_controller_selection.ts index e9907da391..dd6af8ed61 100644 --- a/api/js/etemplate/et2_dataview_controller_selection.ts +++ b/api/js/etemplate/et2_dataview_controller_selection.ts @@ -194,6 +194,12 @@ export class et2_dataview_selectionManager { this._inUpdate = true; + // Don't leave focusedEntry + // @ts-ignore + if(this._focusedEntry !== null && this._focusedEntry.uid == _uid) + { + this.setFocused(_uid, false); + } this._registeredRows[_uid].tr = null; this._registeredRows[_uid].aoi = null; diff --git a/api/js/etemplate/et2_extension_nextmatch.js b/api/js/etemplate/et2_extension_nextmatch.js index d981b0fc48..a2264a57bc 100644 --- a/api/js/etemplate/et2_extension_nextmatch.js +++ b/api/js/etemplate/et2_extension_nextmatch.js @@ -567,11 +567,6 @@ var et2_nextmatch = /** @class */ (function (_super) { * @param uid */ et2_nextmatch.prototype.refresh_update = function (uid) { - if (!this.egw().dataRefreshUID(uid)) { - // Could not update just that row - this.applyFilters(); - return false; - } // Row data update has been sent, let's move it where app wants it var entry = this.controller._selectionMgr._getRegisteredRowsEntry(uid); // Need to delete first as there's a good chance indexes will change in an unknown way diff --git a/api/js/etemplate/et2_extension_nextmatch.ts b/api/js/etemplate/et2_extension_nextmatch.ts index 8f6bf037bc..2b8dcd8535 100644 --- a/api/js/etemplate/et2_extension_nextmatch.ts +++ b/api/js/etemplate/et2_extension_nextmatch.ts @@ -858,13 +858,6 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2 */ protected refresh_update(uid: string) { - if(!this.egw().dataRefreshUID(uid)) - { - // Could not update just that row - this.applyFilters(); - return false; - } - // Row data update has been sent, let's move it where app wants it let entry = this.controller._selectionMgr._getRegisteredRowsEntry(uid);