Jdlrobson has uploaded a new change for review.

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


Change subject: Rename the horrible overlay class to something more meaningful
......................................................................

Rename the horrible overlay class to something more meaningful

Rename badly named mf-navigation.js file

Change-Id: I2d89d756f1756c15b62418e4cb88ffeb537808b8
---
M javascripts/common/Overlay.js
M less/common/overlays.less
M less/modules/talk.less
M less/specials/userlogin.less
M stylesheets/common/overlays.css
M stylesheets/modules/talk.css
M stylesheets/specials/userlogin.css
R tests/javascripts/common/test_Overlay.js
8 files changed, 12 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/94/74094/1

diff --git a/javascripts/common/Overlay.js b/javascripts/common/Overlay.js
index 8fdfa8e..f2ee363 100644
--- a/javascripts/common/Overlay.js
+++ b/javascripts/common/Overlay.js
@@ -51,7 +51,7 @@
                        }
                        this.$el.appendTo( this.appendTo );
                        this.scrollTop = document.body.scrollTop;
-                       $( 'html' ).addClass( 'overlay' );
+                       $( 'html' ).addClass( 'overlayModeEnabled' );
                        $( 'body' ).removeClass( 'navigation-enabled' );
 
                        // skip the URL bar if possible
@@ -62,7 +62,7 @@
                        // M.unlockViewport();
                        this.$el.detach();
                        if ( !this.parent ) {
-                               $( 'html' ).removeClass( 'overlay' );
+                               $( 'html' ).removeClass( 'overlayModeEnabled' );
                                // return to last known scroll position
                                window.scrollTo( document.body.scrollLeft, 
this.scrollTop );
                        } else {
diff --git a/less/common/overlays.less b/less/common/overlays.less
index ed59de4..ade40ce 100644
--- a/less/common/overlays.less
+++ b/less/common/overlays.less
@@ -1,6 +1,6 @@
 @import "../mf-mixins.less";
 
-html.overlay {
+.overlayModeEnabled {
        .mw-mf-overlay {
                display: block;
        }
diff --git a/less/modules/talk.less b/less/modules/talk.less
index 60f026c..662df7b 100644
--- a/less/modules/talk.less
+++ b/less/modules/talk.less
@@ -11,7 +11,7 @@
        font-size: 9px; // FIXME: use pixels for time being as the icon in 
pixels.
 }
 
-.overlay .header {
+.mw-mf-overlay .header {
 
        button.add {
                position: absolute;
diff --git a/less/specials/userlogin.less b/less/specials/userlogin.less
index 02cc555..e5af742 100644
--- a/less/specials/userlogin.less
+++ b/less/specials/userlogin.less
@@ -1,20 +1,5 @@
 @import "../mf-mixins.less";
 
-.overlay {
-
-       body.mw-mf-special {
-               background-color: @overlayContentBackground;
-               .mw-mf-overlay {
-                       .header {
-                               h1 {
-                                       padding-left: @overlayHeadingIndent;
-                               }
-                       }
-               }
-       }
-
-}
-
 #mw-mf-login,
 #mw-mf-accountcreate {
        .watermark {
diff --git a/stylesheets/common/overlays.css b/stylesheets/common/overlays.css
index 6b6a35f..6554b43 100644
--- a/stylesheets/common/overlays.css
+++ b/stylesheets/common/overlays.css
@@ -5,15 +5,15 @@
  * Please edit the corresponding less file instead.
  * See README.mediawiki for details on installing.
  */
-html.overlay .mw-mf-overlay {
+html.overlayModeEnabled .mw-mf-overlay {
   display: block;
 }
-html.overlay #mw-mf-page-center,
-html.overlay #content_wrapper {
+html.overlayModeEnabled #mw-mf-page-center,
+html.overlayModeEnabled #content_wrapper {
   height: 100%;
   overflow: hidden;
 }
-html.overlay #footer {
+html.overlayModeEnabled #footer {
   display: none !important;
 }
 html[dir="rtl"] .mw-mf-overlay .header .cancel {
diff --git a/stylesheets/modules/talk.css b/stylesheets/modules/talk.css
index 8a8db7c..6f252cd 100644
--- a/stylesheets/modules/talk.css
+++ b/stylesheets/modules/talk.css
@@ -14,7 +14,7 @@
   padding-left: 4px;
   font-size: 9px;
 }
-.overlay .header button.add {
+.mw-mf-overlay .header button.add {
   position: absolute;
   right: 0;
   top: 0;
diff --git a/stylesheets/specials/userlogin.css 
b/stylesheets/specials/userlogin.css
index 2b7bfe5..598cda6 100644
--- a/stylesheets/specials/userlogin.css
+++ b/stylesheets/specials/userlogin.css
@@ -5,12 +5,6 @@
  * Please edit the corresponding less file instead.
  * See README.mediawiki for details on installing.
  */
-.overlay body.mw-mf-special {
-  background-color: #ffffff;
-}
-.overlay body.mw-mf-special .mw-mf-overlay .header h1 {
-  padding-left: 0.4em;
-}
 #mw-mf-login .watermark,
 #mw-mf-accountcreate .watermark {
   text-align: center;
diff --git a/tests/javascripts/common/test_mf-navigation.js 
b/tests/javascripts/common/test_Overlay.js
similarity index 87%
rename from tests/javascripts/common/test_mf-navigation.js
rename to tests/javascripts/common/test_Overlay.js
index 2956b35..02df746 100644
--- a/tests/javascripts/common/test_mf-navigation.js
+++ b/tests/javascripts/common/test_Overlay.js
@@ -1,6 +1,6 @@
 ( function( Overlay, $ ) {
 
-QUnit.module( 'MobileFrontend: mf-navigation.js' );
+QUnit.module( 'MobileFrontend: Overlay.js' );
 
 QUnit.test( 'Simple overlay', 1, function() {
        var overlay = new Overlay( { heading: '<h2>Title</h2>', content: 'Text' 
} );
@@ -31,7 +31,7 @@
                        parent: overlay } );
        overlay.show();
        overlayTwo.show();
-       strictEqual( $( 'html' ).hasClass( 'overlay' ), true, 'In overlay mode' 
);
+       strictEqual( $( 'html' ).hasClass( 'overlayModeEnabled' ), true, 'In 
overlay mode' );
        strictEqual( overlayTwo.$el.is( ':visible' ), true,
                'The second overlay is the active one' );
        strictEqual( overlay.$el[0].parentNode, null,
@@ -41,7 +41,7 @@
        overlayTwo.$( '.cancel' ).trigger( 'click' );
        strictEqual( overlayTwo.$el[0].parentNode, null, 'No longer in DOM' );
        strictEqual( overlay.$el[0].parentNode, document.body, 'Still in DOM' );
-       strictEqual( $( 'html' ).hasClass( 'overlay' ), true, 'Still in overlay 
mode' );
+       strictEqual( $( 'html' ).hasClass( 'overlayModeEnabled' ), true, 'Still 
in overlay mode' );
        overlay.hide();
 } );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d89d756f1756c15b62418e4cb88ffeb537808b8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>

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

Reply via email to