From c301c1b194b50594a1e4b7d29e3dc9597f13055a Mon Sep 17 00:00:00 2001 From: nathangray Date: Tue, 15 Dec 2020 09:41:02 -0700 Subject: [PATCH] Etemplate: Fix read-only selectAccount would always add new values causing doubles --- api/js/etemplate/et2_widget_selectAccount.js | 6 ++---- api/js/etemplate/et2_widget_selectAccount.ts | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/api/js/etemplate/et2_widget_selectAccount.js b/api/js/etemplate/et2_widget_selectAccount.js index 8558bb9e12..32cbdff70e 100644 --- a/api/js/etemplate/et2_widget_selectAccount.js +++ b/api/js/etemplate/et2_widget_selectAccount.js @@ -670,10 +670,8 @@ var et2_selectAccount_ro = /** @class */ (function (_super) { .off(); return; } - // Don't make it look like a link - jQuery('li', this.list).removeClass("et2_link et2_link_string") - // No clicks either - .off(); + // Empty it before we fill it + jQuery('li', this.list).remove(); var found = false; if (this.options.select_options && !jQuery.isEmptyObject(this.options.select_options) || this.options.empty_label) { if (!_value) { diff --git a/api/js/etemplate/et2_widget_selectAccount.ts b/api/js/etemplate/et2_widget_selectAccount.ts index ed1d46d0ea..2a1cca27c8 100644 --- a/api/js/etemplate/et2_widget_selectAccount.ts +++ b/api/js/etemplate/et2_widget_selectAccount.ts @@ -837,10 +837,8 @@ export class et2_selectAccount_ro extends et2_link_string return; } - // Don't make it look like a link - jQuery('li',this.list).removeClass("et2_link et2_link_string") - // No clicks either - .off(); + // Empty it before we fill it + jQuery('li',this.list).remove(); let found = false; if(this.options.select_options && !jQuery.isEmptyObject(this.options.select_options) || this.options.empty_label)