extjs-gpl
Version:
GPL licensed version of Sencha Ext JS
42 lines (41 loc) • 1.35 kB
JavaScript
Ext.define('Neptune.view.AppHeader', function() {
Neptune.theme = Ext.Object.fromQueryString(location.search).theme || 'neptune';
return {
extend: 'Ext.container.Container',
xtype: 'appHeader',
layout: 'hbox',
cls: 'app-header',
items: [{
xtype: 'component',
autoEl: {
tag: 'h1'
},
html: document.title,
flex: 1
}, {
xtype: 'combo',
width: 170,
labelWidth: 50,
fieldLabel: 'Theme',
displayField: 'name',
valueField: 'value',
margin: '0 10 0 0',
store: Ext.create('Ext.data.Store', {
fields: ['value', 'name'],
data : [
{ value: 'classic', name: 'Classic' },
{ value: 'gray', name: 'Gray' },
{ value: 'neptune', name: 'Neptune' },
{ value: 'triton', name: 'Triton' }
]
}),
value: Neptune.theme,
listeners: {
select: function(combo) {
var theme = Neptune.theme = combo.getValue();
location.search = (theme === 'default') ? '' : 'theme=' + theme;
}
}
}]
};
});