pve-manager/www/mobile/PVEBar.js
Thomas Lamprecht 5b765ae8b4 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: Thomas Lamprecht <t.lamprecht@proxmox.com>
2015-09-24 06:49:32 +02:00

50 lines
796 B
JavaScript

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);
}
});