]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
button/Button.js: do not sreach for selection model if selModel === null
authorDietmar Maurer <dietmar@proxmox.com>
Sat, 1 Apr 2017 15:54:40 +0000 (17:54 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Sat, 1 Apr 2017 15:54:40 +0000 (17:54 +0200)
For Buttons which needs to trigger when nothing is selected.

button/Button.js

index 56bdd85cf5bd64f651bcd26acf5a171a25400745..835a6668bf180aa79d5f16d130c7817d3eaea792 100644 (file)
@@ -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) {