jenkins-bot has submitted this change and it was merged.

Change subject: Minor refactor
......................................................................


Minor refactor

1. Add comment for empty SPAN when there is no thumbnail
2. Use footer instead of div.timestamp-* as it also contains
   the settings icon now.

Change-Id: Ia6fca32770596c980b33a9a6e58bb08b661b90d1
---
M resources/ext.popups.core.less
M resources/ext.popups.renderer.article.js
2 files changed, 17 insertions(+), 15 deletions(-)

Approvals:
  Jdlrobson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/ext.popups.core.less b/resources/ext.popups.core.less
index 43eddef..95757bc 100644
--- a/resources/ext.popups.core.less
+++ b/resources/ext.popups.core.less
@@ -112,7 +112,7 @@
                        float: right;
                }
 
-               > div.mwe-popups-timestamp-older, 
div.mwe-popups-timestamp-recent {
+               > footer {
                        padding: 16px;
                        margin: 0;
                        font-size: 10px;
@@ -120,14 +120,14 @@
                        bottom: 0;
                        /* @noflip */
                        left: 0;
-               }
 
-               > div.mwe-popups-timestamp-older {
-                       color: #555;
-               }
+                       > div.mwe-popups-timestamp-older {
+                               color: #555;
+                       }
 
-               > div.mwe-popups-timestamp-recent {
-                       color: #00af89;
+                       > div.mwe-popups-timestamp-recent {
+                               color: #00af89;
+                       }
                }
        }
 
@@ -158,7 +158,7 @@
                        float: left;
                }
 
-               div.mwe-popups-timestamp-older, div.mwe-popups-timestamp-recent 
{
+               footer {
                        width: 215px;
                }
        }
@@ -173,7 +173,7 @@
                        padding-bottom: 0;
                }
 
-               div.mwe-popups-timestamp-older, div.mwe-popups-timestamp-recent 
{
+               footer {
                        width: 270px;
                }
        }
diff --git a/resources/ext.popups.renderer.article.js 
b/resources/ext.popups.renderer.article.js
index 4182c47..2a26676 100644
--- a/resources/ext.popups.renderer.article.js
+++ b/resources/ext.popups.renderer.article.js
@@ -137,11 +137,12 @@
                                'mwe-popups-timestamp-older',
                        $settingsImage = $( '<a>' ).addClass( 'mwe-popups-icon 
mwe-popups-settings-icon' ),
                        $surveyImage,
-                       $timestamp = $( '<div>' )
-                               .addClass( timestampclass )
+                       $footer = $( '<footer>' )
                                .append(
-                                       $( '<span>' ).text( mw.message( 
'popups-last-edited',
-                                               moment( timestamp ).fromNow() 
).text() ),
+                                       $( '<span>' )
+                                               .text( mw.message( 
'popups-last-edited',
+                                                       moment( timestamp 
).fromNow() ).text() )
+                                               .addClass( timestampclass ),
                                        $settingsImage
                                );
 
@@ -151,9 +152,10 @@
                                .attr( 'target', '_blank' )
                                .attr( 'title', mw.message( 
'popups-send-feedback' ) )
                                .addClass( 'mwe-popups-icon 
mwe-popups-survey-icon' );
-                       $timestamp.append( $surveyImage );
+                       $footer.append( $surveyImage );
                }
 
+               // createThumbnail returns an empty <span> if there is no 
thumbnail
                if ( $thumbnail.prop( 'tagName' ) !== 'SPAN' ) {
                        $thumbnail = $( '<a>' )
                                .addClass( 'mwe-popups-discreet' )
@@ -163,7 +165,7 @@
                        tall = thumbnail = undefined;
                }
 
-               $div = $( '<div>' ).append( $thumbnail, $contentbox, $timestamp 
);
+               $div = $( '<div>' ).append( $thumbnail, $contentbox, $footer );
 
                mw.popups.render.cache[ href ].settings = {
                        title: page.title,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia6fca32770596c980b33a9a6e58bb08b661b90d1
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: master
Gerrit-Owner: Prtksxna <psax...@wikimedia.org>
Gerrit-Reviewer: AndyRussG <andrew.green...@gmail.com>
Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org>
Gerrit-Reviewer: Prtksxna <psax...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to