From: Dietmar Maurer Date: Sat, 1 Apr 2017 15:54:40 +0000 (+0200) Subject: button/Button.js: do not sreach for selection model if selModel === null X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=6a42adffda00b97df06e20d3dac486dff3b2b152;p=proxmox-widget-toolkit.git button/Button.js: do not sreach for selection model if selModel === null For Buttons which needs to trigger when nothing is selected. --- 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) {