Skip to content

Instantly share code, notes, and snippets.

@lazyfrosch
Created October 12, 2013 22:18
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 lazyfrosch/6955569 to your computer and use it in GitHub Desktop.
Save lazyfrosch/6955569 to your computer and use it in GitHub Desktop.
example logo extender for Icinga Web: lib/js/LogoExtender.js make sure to load this file via the javascript.xml of a module the image is supplied via the pub directory inside a module - or better pub/images/
(function() {
var renderLogo = function(cb) {
var cmp = Ext.getCmp('north-frame');
if(!cmp) {
cb.defer(200,this,[cb]);
} else {
var image = String.format('{0}/modules/MyModule/resources/images/mylogo.png', AppKit.util.Config.get("path"));
// update main component - if necessary ("backport" from a 1.9 feature)
// only needed when on < 1.9.0
summary = cmp.items.first();
if(!summary.flex) {
summary.flex = 1;
summary.width = undefined;
summary.minWidth = 675;
}
cmp.add({
xtype: 'panel',
width: 200,
flex: undefined,
bodyCfg: {
style: {
'background-image': 'url('+image+')',
'background-repeat': 'no-repeat',
'background-position': 'center right'
}
}
});
if(cmp.rendered) cmp.doLayout();
}
};
Ext.onReady(renderLogo.createCallback(renderLogo));
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment