mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-28 01:50:09 +00:00
Merge "Toggle the panel when "view more" is clicked"
This commit is contained in:
commit
b4659bbc8c
|
@ -196,7 +196,7 @@
|
|||
|
||||
this.initializeCredit();
|
||||
this.description = new mw.mmv.ui.Description( this.$imageMetadataLeft );
|
||||
this.permission = new mw.mmv.ui.Permission( this.$imageMetadataLeft );
|
||||
this.permission = new mw.mmv.ui.Permission( this.$imageMetadataLeft, this.scroller );
|
||||
this.initializeImageLinks();
|
||||
};
|
||||
|
||||
|
|
|
@ -27,8 +27,9 @@
|
|||
* @extends mw.mmv.ui.Element
|
||||
* @constructor
|
||||
* @param {jQuery} $container
|
||||
* @param {mw.mmv.ui.MetadataPanelScroller} scroller
|
||||
*/
|
||||
function Permission( $container ) {
|
||||
function Permission( $container, scroller ) {
|
||||
var permission = this;
|
||||
|
||||
mw.mmv.ui.Element.call( this, $container );
|
||||
|
@ -64,6 +65,7 @@
|
|||
.on( 'click', '.mw-mmv-permission-text-viewmore', function( e ) {
|
||||
e.preventDefault();
|
||||
permission.grow();
|
||||
permission.scroller.toggle( 'up' );
|
||||
} )
|
||||
;
|
||||
|
||||
|
@ -99,6 +101,12 @@
|
|||
permission.shrink();
|
||||
} )
|
||||
.appendTo( this.$box );
|
||||
|
||||
/**
|
||||
* Panel scroller from the metadata panel object.
|
||||
* @property {mw.mmv.ui.MetadataPanelScroller}
|
||||
*/
|
||||
this.scroller = scroller;
|
||||
}
|
||||
oo.inheritClass( Permission, mw.mmv.ui.Element );
|
||||
P = Permission.prototype;
|
||||
|
|
Loading…
Reference in a new issue