Mooeypoo has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/187617

Change subject: Use css class rather than jQuery show/hide
......................................................................

Use css class rather than jQuery show/hide

* Dependent on Ibf7c99 *

Change-Id: I1d968b25f6d435b5fe68b8cec42b044a5c4f5661
---
M src/ce/nodes/ve.ce.TableNode.js
M src/ce/ve.ce.ResizableNode.js
M src/ui/inspectors/ve.ui.SpecialCharacterInspector.js
M src/ui/ve.ui.Context.js
M src/ui/ve.ui.MobileContext.js
5 files changed, 15 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/17/187617/1

diff --git a/src/ce/nodes/ve.ce.TableNode.js b/src/ce/nodes/ve.ce.TableNode.js
index 6d9f430..13e3a38 100644
--- a/src/ce/nodes/ve.ce.TableNode.js
+++ b/src/ce/nodes/ve.ce.TableNode.js
@@ -62,7 +62,7 @@
        } );
 
        this.$overlay = this.$( '<div>' )
-               .hide()
+               .addClass( 'oo-ui-element-hidden' )
                .addClass( 've-ce-tableNodeOverlay' )
                .append( [
                        this.$selectionBox,
@@ -306,7 +306,7 @@
 
        if ( active ) {
                if ( !this.active ) {
-                       this.$overlay.show();
+                       this.$overlay.removeClass( 'oo-ui-element-hidden' );
                        // Only register touchstart event after table has 
become active to prevent
                        // accidental focusing of the table while scrolling
                        this.$element.on( 'touchstart.ve-ce-tableNode', 
this.onTableMouseDown.bind( this ) );
@@ -314,7 +314,7 @@
                this.surface.setActiveTableNode( this );
                this.updateOverlayDebounced();
        } else if ( !active && this.active ) {
-               this.$overlay.hide();
+               this.$overlay.addClass( 'oo-ui-element-hidden' );
                if ( this.editingFragment ) {
                        this.setEditing( false, true );
                }
diff --git a/src/ce/ve.ce.ResizableNode.js b/src/ce/ve.ce.ResizableNode.js
index 83796e7..9f2a0c8 100644
--- a/src/ce/ve.ce.ResizableNode.js
+++ b/src/ce/ve.ce.ResizableNode.js
@@ -123,7 +123,7 @@
        } );
        // Actually hide the size label after it's done animating
        setTimeout( function () {
-               node.$sizeLabel.hide();
+               node.$sizeLabel.addClass( 'oo-ui-element-hidden' );
        }, 200 );
 };
 
@@ -150,7 +150,7 @@
                height = dimensions.height;
        }
        this.$sizeLabel
-               .show()
+               .removeClass( 'oo-ui-element-hidden' )
                .addClass( 've-ce-resizableNode-sizeLabel-resizing' )
                .css( {
                        top: top,
diff --git a/src/ui/inspectors/ve.ui.SpecialCharacterInspector.js 
b/src/ui/inspectors/ve.ui.SpecialCharacterInspector.js
index b6b3411..b126553 100644
--- a/src/ui/inspectors/ve.ui.SpecialCharacterInspector.js
+++ b/src/ui/inspectors/ve.ui.SpecialCharacterInspector.js
@@ -75,7 +75,7 @@
                        this.getFragment().insertContent( ' ' );
                        // Don't request the character list again if we already 
have it
                        if ( !this.characters ) {
-                               this.$spinner.show();
+                               this.$spinner.removeClass( 
'oo-ui-element-hidden' );
                                this.fetchCharList()
                                        .done( function () {
                                                inspector.buildButtonList();
@@ -83,7 +83,7 @@
                                        // TODO: show error message on 
fetchCharList().fail
                                        .always( function () {
                                                // TODO: generalize push/pop 
pending, like we do in Dialog
-                                               inspector.$spinner.hide();
+                                               inspector.$spinner.addClass( 
'oo-ui-element-hidden' );
                                        } );
                        }
                }, this );
diff --git a/src/ui/ve.ui.Context.js b/src/ui/ve.ui.Context.js
index 386a1d6..34bb710 100644
--- a/src/ui/ve.ui.Context.js
+++ b/src/ui/ve.ui.Context.js
@@ -38,7 +38,9 @@
        // Initialization
        // Hide element using a class, not this.toggle, as child implementations
        // of toggle may require the instance to be fully constructed before 
running.
-       this.$element.addClass( 've-ui-context' );
+       this.$element
+               .addClass( 've-ui-context' )
+               .addClass( 'oo-ui-element-hidden' );
        this.menu.toggle( false );
        this.inspectors.$element.addClass( 've-ui-context-inspectors' );
 };
@@ -324,7 +326,7 @@
        show = show === undefined ? !this.visible : !!show;
        if ( show !== this.visible ) {
                this.visible = show;
-               this.$element.toggle();
+               this.$element.toggleClass( 'oo-ui-element-hidden', 
!this.visible );
        }
        return $.Deferred().resolve().promise();
 };
diff --git a/src/ui/ve.ui.MobileContext.js b/src/ui/ve.ui.MobileContext.js
index 290b10c..1b2050b 100644
--- a/src/ui/ve.ui.MobileContext.js
+++ b/src/ui/ve.ui.MobileContext.js
@@ -31,8 +31,7 @@
        this.$element
                .addClass( 've-ui-mobileContext' )
                .append( this.menu.$element )
-               // Mobile context uses a class to toggle visibility
-               .show();
+               .removeClass( 'oo-ui-element-hidden' );
        this.menu.$element.addClass( 've-ui-mobileContext-menu' );
        this.inspectors.$element.addClass( 've-ui-mobileContext-inspectors' );
        this.surface.getGlobalOverlay().$element.append( 
this.inspectors.$element );
@@ -72,7 +71,9 @@
        show = show === undefined ? !this.visible : !!show;
        if ( show !== this.visible ) {
                this.visible = show;
-               this.$element.toggleClass( 've-ui-mobileContext-visible', show 
);
+               this.$element
+                       .toggleClass( 've-ui-mobileContext-visible', show );
+                       .toggleClass( 'oo-ui-element-hidden', !show );
                setTimeout( function () {
                        deferred.resolve();
                }, 300 );

-- 
To view, visit https://gerrit.wikimedia.org/r/187617
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d968b25f6d435b5fe68b8cec42b044a5c4f5661
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to