From 6a42adffda00b97df06e20d3dac486dff3b2b152 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sat, 1 Apr 2017 17:54:40 +0200 Subject: [PATCH] button/Button.js: do not sreach for selection model if selModel === null For Buttons which needs to trigger when nothing is selected. --- button/Button.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/button/Button.js b/button/Button.js index 56bdd85..835a666 100644 --- a/button/Button.js +++ b/button/Button.js @@ -63,18 +63,20 @@ Ext.define('Proxmox.button.Button', { me.callParent(); - if (!me.selModel) { + if (!me.selModel && me.selModel !== null) { var grid = me.up('grid'); if (grid && grid.selModel) { me.selModel = grid.selModel; - if (me.waitMsgTarget === true) { - me.waitMsgTarget = grid; - } } } if (me.waitMsgTarget === true) { - throw "unable to find waitMsgTarget"; // no grid found + var grid = me.up('grid'); + if (grid) { + me.waitMsgTarget = grid; + } else { + throw "unable to find waitMsgTarget"; + } } if (me.selModel) { -- 2.39.2