X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=resources%2Fsrc%2Fmediawiki.rcfilters%2Fui%2Fmw.rcfilters.ui.SavedLinksListItemWidget.js;h=71e3b55c01fb7e3aa14075b5f9c594cfddcece1a;hb=f6870e58acb0828b0b7a3437e00a8989f2437888;hp=b6b20eeb1aed32e2e412e3f7b018ba30d2a955bd;hpb=8e185ecb2b53217665ea53f63119a28b3f80ff56;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListItemWidget.js b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListItemWidget.js index b6b20eeb1a..71e3b55c01 100644 --- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListItemWidget.js +++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListItemWidget.js @@ -2,6 +2,7 @@ /** * Quick links menu option widget * + * @class * @extends OO.ui.Widget * @mixins OO.ui.mixin.LabelElement * @mixins OO.ui.mixin.IconElement @@ -92,6 +93,7 @@ } ); this.$element.on( { click: this.onClick.bind( this ) } ); this.$label.on( { click: this.onClick.bind( this ) } ); + this.$icon.on( { click: this.onDefaultIconClick.bind( this ) } ); // Prevent propagation on mousedown for the save button // so the menu doesn't close this.saveButton.$element.on( { mousedown: function () { return false; } } ); @@ -177,6 +179,18 @@ this.emit( 'click' ); } }; + + /** + * Respond to click on the 'default' icon. Open the submenu where the + * default state can be changed. + * + * @return {boolean} false + */ + mw.rcfilters.ui.SavedLinksListItemWidget.prototype.onDefaultIconClick = function () { + this.menu.toggle(); + return false; + }; + /** * Respond to popup button click event */ @@ -211,7 +225,7 @@ * Respond to input keyup event, this is the way to intercept 'escape' key * * @param {jQuery.Event} e Event data - * @returns {boolean} false + * @return {boolean} false */ mw.rcfilters.ui.SavedLinksListItemWidget.prototype.onInputKeyup = function ( e ) { if ( e.which === OO.ui.Keys.ESCAPE ) { @@ -306,7 +320,7 @@ /** * Get item ID * - * @returns {string} Query identifier + * @return {string} Query identifier */ mw.rcfilters.ui.SavedLinksListItemWidget.prototype.getID = function () { return this.model.getID();