AndyRussG has uploaded a new change for review.

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


Change subject: Added the bufferOffset property to guiders
......................................................................

Added the bufferOffset property to guiders

Added the bufferOffset property to guiders as an alternative
way to tweak guider position, which may be more appropraite
than the existing offset{left, top} setting. This setting
provides direct access to the bufferOffset value used
to position guiders.  This change is somewhat experimentaly,
having not been thoroughly tested, however it is minor and
seems unlikely to break anything.

Change-Id: I1bfd9637e4b67365e4a106464fff9b4e3887cf40
---
M modules/mediawiki.libs.guiders/mediawiki.libs.guiders.js
1 file changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GuidedTour 
refs/changes/68/79568/1

diff --git a/modules/mediawiki.libs.guiders/mediawiki.libs.guiders.js 
b/modules/mediawiki.libs.guiders/mediawiki.libs.guiders.js
index 369f1b2..6b180bb 100644
--- a/modules/mediawiki.libs.guiders/mediawiki.libs.guiders.js
+++ b/modules/mediawiki.libs.guiders/mediawiki.libs.guiders.js
@@ -89,6 +89,7 @@
                        top: null,
                        left: null
                },
+               bufferOffset: null,
                onClose: null, // Function taking two arguments, the guider and 
a boolean for close type (false for text close button, true for everything 
else).  Returns true to end tour, false or undefined to dismiss current step.  
If there is no function, dismiss-only is default.
                onHide: null,
                onShow: null,
@@ -414,7 +415,12 @@
 
                attachToHeight = attachTo.innerHeight();
                attachToWidth = attachTo.innerWidth();
-               bufferOffset = 0.9 * guiders._arrowSize;
+
+               if (guider.bufferOffset !== null) {
+                       bufferOffset = guider.bufferOffset;
+               } else {
+                       bufferOffset = 0.9 * guiders._arrowSize;
+               }
 
                // offsetMap follows the form: [height, width]
                offsetMap = {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1bfd9637e4b67365e4a106464fff9b4e3887cf40
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GuidedTour
Gerrit-Branch: master
Gerrit-Owner: AndyRussG <[email protected]>

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

Reply via email to