Yuvipanda has submitted this change and it was merged.

Change subject: Flip the starting point of the popup if its on the right side 
of the screen
......................................................................


Flip the starting point of the popup if its on the right side of the screen

Change-Id: I7a3fea220d051e0d70fcbf0be3d0557ee24c5da2
---
M resources/ext.popups.core.js
1 file changed, 8 insertions(+), 1 deletion(-)

Approvals:
  Yuvipanda: Verified; Looks good to me, approved



diff --git a/resources/ext.popups.core.js b/resources/ext.popups.core.js
index 69c6756..9e9642c 100644
--- a/resources/ext.popups.core.js
+++ b/resources/ext.popups.core.js
@@ -21,7 +21,9 @@
                                landscapeImage: {
                                        h: 200, // Max height
                                        w: 300 // Exact Width
-                               }
+                               },
+                               landscapePopupWidth: 450, // Exact width of a 
landscape popup
+                               portraitPopupWidth: 300 // Exact width of a 
portrait popup
                        },
                        $svg, $box; // defined at the end of the file
 
@@ -175,6 +177,11 @@
                                bar.tall = false;
                        }
 
+                       if ( offsetLeft > ( $( window ).width() / 2 ) ) {
+                               offsetLeft = offsetLeft + $el.width();
+                               offsetLeft -= ( !bar.tall ) ? 
SIZES.portraitPopupWidth : SIZES.landscapePopupWidth;
+                       }
+
                        $box
                                .children()
                                .detach()

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7a3fea220d051e0d70fcbf0be3d0557ee24c5da2
Gerrit-PatchSet: 12
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: master
Gerrit-Owner: Prtksxna <psax...@wikimedia.org>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: MarkTraceur <mtrac...@member.fsf.org>
Gerrit-Reviewer: Prtksxna <psax...@wikimedia.org>
Gerrit-Reviewer: Spage <sp...@wikimedia.org>
Gerrit-Reviewer: Yuvipanda <yuvipa...@gmail.com>

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

Reply via email to