Skip to content

Instantly share code, notes, and snippets.

@dmackerman
Created January 23, 2013 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dmackerman/4610799 to your computer and use it in GitHub Desktop.
Save dmackerman/4610799 to your computer and use it in GitHub Desktop.
/**
* @class McAfee.view.main.Viewport
* @extends Ext.container.Container
* @author Crysfel Villa <crysfel@moduscreate.com>
*
* Description
*/
Ext.define('McAfee.view.main.Viewport',{
extend : 'Ext.container.Container',
alias : 'widget.main-viewport',
requires : [
'McAfee.view.main.SkinnyHeader',
'Ext.layout.container.Border',
'McAfee.abstract.tab.Panel'
],
cls: 'main-viewport',
initComponent : function(){
var me = this;
me.items = me.buildItems();
me.callParent();
},
activate: function(viewport, e) {
var me = this;
console.log(viewport);
console.log(e);
me.element.on({
click: me.onViewportClick,
scope: me
});
},
onViewportClick: function(evtObj) {
// var me = this,
// dataset = evtObj.delegatedTarget.dataset;
alert('yay');
// if(evtObj.getTarget('.hero-back')) {
// me.fireEvent('close', me);
// } else {
// me.fireEvent('heroOverviewTap', dataset.battletag, dataset.id);
// }
},
buildItems : function(){
return [{
xtype : 'skinnyheader',
data : this.headerData,
height: 170
}, {
xtype : 'mcafeetabpanel',
itemId: 'mainTabs',
cls : 'mainTabs',
border: false,
bodyBorder: false,
tabBar: {
items: [{
xtype: 'tbfill'
}, {
closable: false,
text: '<i class="icon-wrench"></i> IR Tools',
itemId: 'IRToolsButton',
enableToggle: true
}]
},
items : [{
xtype : 'dashboard',
itemId : 'dashboardPanelContainer'
},{
xtype : 'sessions'
},{
xtype : 'behaviors'
},{
xtype : 'file_captures'
},{
xtype : 'host_ratings'
}]
}];
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment