Commit 4496e999 authored by Thomas Lamprecht's avatar Thomas Lamprecht Committed by Dietmar Maurer

add PVEBar class to provide an common menu titlebar

PVEBar inherits from Ext.TitleBar and provides an titlebar for the
PVE mobile components to reduce code reuse.
Signed-off-by: 's avatarThomas Lamprecht <t.lamprecht@proxmox.com>
parent ebe5456a
......@@ -8,6 +8,7 @@ JSSRC= \
Toolkit.js \
PVEProxy.js \
MenuButton.js \
PVEBar.js \
Workspace.js \
NodeSelector.js \
RealmSelector.js \
......
Ext.define('PVE.ATitleBar', {
extend: 'Ext.TitleBar',
alias: ['widget.pveTitleBar'],
config: {
docked: 'top',
pveReloadButton: true,
pveBackButton: true,
pveStdMenu: true // add 'Login' and 'Datacenter' to menu by default
},
initialize: function() {
var me = this;
me.callParent();
var items = [];
if (me.getPveBackButton()) {
items.push({
align: 'left',
iconCls: 'arrow_left',
handler: function() {
PVE.Workspace.goBack();
}
});
}
if (me.getPveReloadButton()) {
items.push({
align: 'right',
iconCls: 'refresh',
handler: function() {
this.up('pvePage').reload();
}
});
}
items.push({
xtype: 'pveMenuButton',
align: 'right',
pveStdMenu: me.getPveStdMenu()
});
me.setItems(items);
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment