RCFilters: Adjust pushpin 'default' icon behavior and style
authorMoriel Schottlender <moriel@gmail.com>
Wed, 23 Aug 2017 23:10:23 +0000 (16:10 -0700)
committerMoriel Schottlender <moriel@gmail.com>
Thu, 24 Aug 2017 00:02:47 +0000 (17:02 -0700)
Bug: T173264
Change-Id: I8d977bb97e91a19c24527c66120f142738135730

resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListItemWidget.js

index 2daa76e..e7433e2 100644 (file)
                // then the icon needs to be slightly smaller as well, so that
                // when we toggle 'default' the icon doesn't bounce the option
                // height up a little
-               width: 1.7em;
-               height: 1.7em;
+               width: 1.2em;
+               height: 1.2em;
+               min-width: 16px;
+               min-height: 16px;
+               opacity: 0.5;
        }
 
        &-icon span {
index 3655c16..71e3b55 100644 (file)
@@ -93,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; } } );
                        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
         */