Created
October 12, 2013 22:18
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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