From 6353e22c00bd67c68c4a13d4e69ea61bb9ed8bd2 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 12 Apr 2022 16:18:43 +0200 Subject: [PATCH] ui: datastore options: factor out update stop/start to controller Signed-off-by: Thomas Lamprecht --- www/datastore/OptionView.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/www/datastore/OptionView.js b/www/datastore/OptionView.js index 25fe71dc..fdba54df 100644 --- a/www/datastore/OptionView.js +++ b/www/datastore/OptionView.js @@ -64,6 +64,15 @@ Ext.define('PBS.Datastore.Options', { }, }); }, + + stopUpdates: function() { + let view = this.getView(); + view.rstore.stopUpdate(); + }, + startUpdates: function() { + let view = this.getView(); + view.rstore.startUpdate(); + }, }, tbar: [ @@ -84,9 +93,9 @@ Ext.define('PBS.Datastore.Options', { ], listeners: { - activate: function() { this.rstore.startUpdate(); }, - destroy: function() { this.rstore.stopUpdate(); }, - deactivate: function() { this.rstore.stopUpdate(); }, + activate: 'startUpdates', + beforedestroy: 'stopUpdates', + deactivate: 'stopUpdates', itemdblclick: 'edit', },