User:Mike Peel/common.js
Jump to navigation
Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
The accompanying .css page for this skin can be added at User:Mike Peel/common.css. |
mw.loader.using( 'wikibase.mediainfo.base', function () {
var ComponentWidget = require( 'wikibase.mediainfo.base' ).ComponentWidget;
mw.hook( 'wikipage.content' ).add( function () {
$( '.wbmi-entityview-captionsPanel' ).makeCollapsible( { collapsed: true } );
} );
// Ugly hooking :(
ComponentWidget.prototype.render = function ( orig ) {
return function () {
orig.apply( this, arguments );
if ( this.moduleName === 'wikibase.mediainfo.filePageDisplay' ) {
this.renderPromise.then( function () {
$( '.wbmi-entityview-captionsPanel' ).makeCollapsible( { collapsed: true } );
} );
}
};
} ( ComponentWidget.prototype.render );
} );