ui: panel/ConfigPanel: eslint fixes

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
This commit is contained in:
Dominic Jäger 2021-05-19 12:56:18 +02:00 committed by Thomas Lamprecht
parent ff0777c520
commit ee3903451e

View File

@ -68,11 +68,11 @@ Ext.define('PVE.panel.Config', {
singleExpand: false, singleExpand: false,
listeners: { listeners: {
selectionchange: function(treeList, selection) { selectionchange: function(treeList, selection) {
var me = this.up('panel'); let view = this.up('panel');
me.suspendLayout = true; view.suspendLayout = true;
me.activateCard(selection.data.id); view.activateCard(selection.data.id);
me.suspendLayout = false; view.suspendLayout = false;
me.updateLayout(); view.updateLayout();
}, },
itemclick: function(treelist, info) { itemclick: function(treelist, info) {
var olditem = treelist.getSelection(); var olditem = treelist.getSelection();
@ -123,6 +123,7 @@ Ext.define('PVE.panel.Config', {
menu.setSelection(selection); menu.setSelection(selection);
return cardid; return cardid;
} }
return '';
}, },
activateCard: function(cardid) { activateCard: function(cardid) {
@ -160,7 +161,7 @@ Ext.define('PVE.panel.Config', {
var activeTab; // leaving this undefined means items[0] will be the default tab var activeTab; // leaving this undefined means items[0] will be the default tab
if (stateid) { if (stateid) {
var state = me.sp.get(stateid); let state = me.sp.get(stateid);
if (state && state.value) { if (state && state.value) {
// if this tab does not exist, it chooses the first // if this tab does not exist, it chooses the first
activeTab = state.value; activeTab = state.value;
@ -259,7 +260,7 @@ Ext.define('PVE.panel.Config', {
var acard = me.getLayout().getActiveItem().itemId; var acard = me.getLayout().getActiveItem().itemId;
// get the itemid of the new value // get the itemid of the new value
var ncard = state.value || me.firstItem; var ncard = state.value || me.firstItem;
if (ncard && acard != ncard) { if (ncard && acard !== ncard) {
// select the chosen item // select the chosen item
menu.setSelection(root.findChild('id', ncard, true) || root.firstChild); menu.setSelection(root.findChild('id', ncard, true) || root.firstChild);
} }