X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fsrc%2Fmediawiki.widgets%2Fmw.widgets.CalendarWidget.js;h=997110c7867c2ebe4080004dfe5ce610cd97821c;hb=0d6ef1c0b20093e03e95a6b7f303c7a2de5de3af;hp=b91617e789d8411760a68a039dee9f3bf08dd7e4;hpb=6f7e982df6479e27c3b17f2deda8404ef55f50e6;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/mediawiki.widgets/mw.widgets.CalendarWidget.js b/resources/src/mediawiki.widgets/mw.widgets.CalendarWidget.js index b91617e789..997110c786 100644 --- a/resources/src/mediawiki.widgets/mw.widgets.CalendarWidget.js +++ b/resources/src/mediawiki.widgets/mw.widgets.CalendarWidget.js @@ -5,7 +5,7 @@ * @license The MIT License (MIT); see LICENSE.txt */ /* global moment */ -( function ( $, mw ) { +( function () { /** * Creates an mw.widgets.CalendarWidget object. @@ -177,6 +177,7 @@ switch ( this.displayLayer ) { case 'month': this.labelButton.setLabel( this.moment.format( 'MMMM YYYY' ) ); + this.labelButton.toggle( true ); this.upButton.toggle( true ); // First week displayed is the first week spanned by the month, unless it begins on Monday, in @@ -216,6 +217,7 @@ case 'year': this.labelButton.setLabel( this.moment.format( 'YYYY' ) ); + this.labelButton.toggle( true ); this.upButton.toggle( true ); currentMonth = moment( this.moment ).startOf( 'year' ); @@ -248,6 +250,7 @@ case 'duodecade': this.labelButton.setLabel( null ); + this.labelButton.toggle( false ); this.upButton.toggle( false ); currentYear = moment( { year: Math.floor( this.moment.year() / 20 ) * 20 } ); @@ -318,6 +321,8 @@ framed: false, classes: [ 'mw-widget-calendarWidget-labelButton' ] } ); + // FIXME This button is actually not clickable because labelButton covers it, + // should it just be a plain icon? this.upButton = new OO.ui.ButtonWidget( { tabIndex: -1, framed: false, @@ -345,8 +350,8 @@ this.$header.append( this.prevButton.$element, this.nextButton.$element, - this.upButton.$element, - this.labelButton.$element + this.labelButton.$element, + this.upButton.$element ); }; @@ -588,4 +593,4 @@ return this; }; -}( jQuery, mediaWiki ) ); +}() );