TheDJ has uploaded a new change for review.

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

Change subject: Popups: Some small cleanup.
......................................................................

Popups: Some small cleanup.

Bunch attr actions, add to dom as the last action, rm superflous lines
and use strict.

Change-Id: I3e0870b108e978d7fd4093a6e7201fb6260f2e88
---
M resources/ext.popups.core.js
M resources/ext.popups.renderer.article.js
2 files changed, 9 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups 
refs/changes/69/134269/1

diff --git a/resources/ext.popups.core.js b/resources/ext.popups.core.js
index 7e23758..80e484d 100644
--- a/resources/ext.popups.core.js
+++ b/resources/ext.popups.core.js
@@ -1,4 +1,5 @@
 ( function ( $, mw ) {
+       'use strict';
 
        /**
         * @class mw.popups
@@ -48,7 +49,6 @@
 
                $( '<div>' )
                        .attr( 'id', 'mwe-popups-svg' )
-                       .appendTo( document.body )
                        .html(
                                '<svg width="0" height="0">' +
                                        '<defs>' +
@@ -64,10 +64,10 @@
                                                '<clippath 
id="mwe-popups-landscape-mask-flip">' +
                                                        '<polygon points="0 0, 
1000 0, 1000 243, 190 243, 182 250, 174 243, 0 243"/>' +
                                                '</clippath>' +
-
                                        '</defs>' +
                                '</svg>'
-                       );
+                       )
+                       .appendTo( document.body );
                return true;
        };
 
@@ -78,9 +78,11 @@
         */
        mw.popups.createPopupElement = function () {
                mw.popups.$popup = $( '<div>' )
-                       .attr( 'role', 'tooltip' )
-                       .attr( 'aria-hidden', 'true' )
-                       .addClass( 'mwe-popups' )
+                       .attr( {
+                               'class': 'mwe-popups',
+                               'role': 'tooltip',
+                               'aria-hidden': 'true'
+                       } )
                        .appendTo( document.body );
        };
 
diff --git a/resources/ext.popups.renderer.article.js 
b/resources/ext.popups.renderer.article.js
index 720c8d3..0e847a1 100644
--- a/resources/ext.popups.renderer.article.js
+++ b/resources/ext.popups.renderer.article.js
@@ -1,4 +1,5 @@
 ( function ( $, mw ) {
+       'use strict';
 
        /**
         * @class mw.popups.render.article
@@ -395,7 +396,6 @@
 
                if ( !svg && flippedY && !tall ) {
                        $( '.mwe-popups-extract' ).css( 'margin-top', '206px' );
-
                }
 
                if ( flippedY ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e0870b108e978d7fd4093a6e7201fb6260f2e88
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: master
Gerrit-Owner: TheDJ <hartman.w...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to