ui: menu/item: eslint fixes and code cleanup/refactoring/modernize
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
8f6397a2a3
commit
bdc157f8f4
@ -9,27 +9,23 @@ Ext.define('PVE.menu.Item', {
|
|||||||
dangerous: false,
|
dangerous: false,
|
||||||
|
|
||||||
initComponent: function() {
|
initComponent: function() {
|
||||||
var me = this;
|
let me = this;
|
||||||
|
|
||||||
if (me.handler) {
|
if (me.handler) {
|
||||||
me.setHandler(me.handler, me.scope);
|
me.setHandler(me.handler, me.scope);
|
||||||
}
|
}
|
||||||
|
|
||||||
me.callParent();
|
me.callParent();
|
||||||
},
|
},
|
||||||
|
|
||||||
setHandler: function(fn, scope) {
|
setHandler: function(fn, scope) {
|
||||||
var me = this;
|
let me = this;
|
||||||
me.scope = scope;
|
me.scope = scope;
|
||||||
me.handler = function(button, e) {
|
me.handler = function(button, e) {
|
||||||
var rec, msg;
|
|
||||||
if (me.confirmMsg) {
|
if (me.confirmMsg) {
|
||||||
msg = me.confirmMsg;
|
|
||||||
Ext.MessageBox.defaultButton = me.dangerous ? 2 : 1;
|
Ext.MessageBox.defaultButton = me.dangerous ? 2 : 1;
|
||||||
Ext.Msg.show({
|
Ext.Msg.show({
|
||||||
title: gettext('Confirm'),
|
title: gettext('Confirm'),
|
||||||
icon: me.dangerous ? Ext.Msg.WARNING : Ext.Msg.QUESTION,
|
icon: me.dangerous ? Ext.Msg.WARNING : Ext.Msg.QUESTION,
|
||||||
msg: msg,
|
msg: me.confirmMsg,
|
||||||
buttons: Ext.Msg.YESNO,
|
buttons: Ext.Msg.YESNO,
|
||||||
defaultFocus: me.dangerous ? 'no' : 'yes',
|
defaultFocus: me.dangerous ? 'no' : 'yes',
|
||||||
callback: function(btn) {
|
callback: function(btn) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user