button/Button.js: do not sreach for selection model if selModel === null

For Buttons which needs to trigger when nothing is selected.
This commit is contained in:
Dietmar Maurer 2017-04-01 17:54:40 +02:00
parent 7d9225e651
commit 6a42adffda

View 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) {