]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/menu/MenuItem.js
1 Ext
.define('PVE.menu.Item', {
2 extend
: 'Ext.menu.Item',
3 alias
: 'widget.pveMenuItem',
5 // set to wrap the handler callback in a confirm dialog showing this text
8 // set to focus 'No' instead of 'Yes' button and show a warning symbol
11 initComponent: function() {
15 me
.setHandler(me
.handler
, me
.scope
);
21 setHandler: function(fn
, scope
) {
24 me
.handler = function(button
, e
) {
28 Ext
.MessageBox
.defaultButton
= me
.dangerous
? 2 : 1;
30 title
: gettext('Confirm'),
31 icon
: me
.dangerous
? Ext
.Msg
.WARNING
: Ext
.Msg
.QUESTION
,
33 buttons
: Ext
.Msg
.YESNO
,
34 defaultFocus
: me
.dangerous
? 'no' : 'yes',
35 callback: function(btn
) {
37 Ext
.callback(fn
, me
.scope
, [me
, e
], 0, me
);
42 Ext
.callback(fn
, me
.scope
, [me
, e
], 0, me
);