ApiFeedWatchlist: Use guessSectionNameFromWikiText()
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / ui / mw.rcfilters.ui.DateButtonWidget.js
index 681b350..82607f1 100644 (file)
@@ -2,6 +2,7 @@
        /**
         * Widget defining the button controlling the popup for the date range for the results
         *
+        * @class
         * @extends OO.ui.Widget
         *
         * @constructor
@@ -62,7 +63,7 @@
                                        width: 300,
                                        padded: true,
                                        anchor: false,
-                                       align: 'backwards',
+                                       align: 'forwards',
                                        $autoCloseIgnore: this.$overlay,
                                        $content: datePopupWidget.$element
                                }
         * @param {string} filterName Chosen filter name
         */
        mw.rcfilters.ui.DateButtonWidget.prototype.onPopupDays = function ( filterName ) {
+               var item = this.daysGroupModel.getItemByName( filterName );
+
                this.controller.toggleFilterSelect( filterName, true );
+               this.controller.updateDaysDefault( item.getParamName() );
+               this.button.popup.toggle( false );
        };
 
        /**
                if ( item ) {
                        this.button.setLabel(
                                mw.msg(
-                                       // Number( item.getParamName() ) < 1 ?
-                                       //      'rcfilters-days-show-hours' : 'rcfilters-days-show-days',
-
-                                       // Temporarily hide the functionality for hours, use days only
-                                       'rcfilters-days-show-days',
+                                       Number( item.getParamName() ) < 1 ?
+                                               'rcfilters-days-show-hours' : 'rcfilters-days-show-days',
                                        item.getLabel()
                                )
                        );