RCFilters UI: Display popups above CapsuleItemWidgets
authorRoan Kattouw <roan.kattouw@gmail.com>
Sat, 4 Mar 2017 03:16:42 +0000 (19:16 -0800)
committerRoan Kattouw <roan.kattouw@gmail.com>
Sat, 4 Mar 2017 03:16:42 +0000 (19:16 -0800)
Depends on I6f2d03ac83aa in oojs-ui

Change-Id: Ia0ff92ef34431827c80a4bc86b391f9d3a3a8958

resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.CapsuleItemWidget.js

index 05f2f66..a1cee21 100644 (file)
@@ -38,6 +38,7 @@
                        popup: {
                                padded: false,
                                align: 'center',
+                               position: 'above',
                                $content: $popupContent
                                        .append( descLabelWidget.$element ),
                                $floatableContainer: this.$element,
        mw.rcfilters.ui.CapsuleItemWidget.prototype.onMouseEnter = function () {
                if ( this.model.getDescription() ) {
                        if ( !this.positioned ) {
-                               // Recalculate position to be center of the capsule item
-                               this.popup.$element.css( 'margin-left', ( this.$element.width() / 2 ) );
+                               // Recalculate anchor position to be center of the capsule item
+                               this.popup.$anchor.css( 'margin-left', ( this.$element.width() / 2 ) );
                                this.positioned = true;
                        }