Mattflaschen has uploaded a new change for review.

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


Change subject: Use Next/Okay conditionally depending on whether there are edit 
links.
......................................................................

Use Next/Okay conditionally depending on whether there are edit links.

Change-Id: Ib357c9c3b680e6dc907b4cf95972684e627c0dff
---
M resources/tours/gettingstartedtasktoolbar.js
1 file changed, 8 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GettingStarted 
refs/changes/32/63832/1

diff --git a/resources/tours/gettingstartedtasktoolbar.js 
b/resources/tours/gettingstartedtasktoolbar.js
index aec9012..676559f 100644
--- a/resources/tours/gettingstartedtasktoolbar.js
+++ b/resources/tours/gettingstartedtasktoolbar.js
@@ -8,6 +8,10 @@
                return;
        }
 
+       // The code around here is a bit of a hack, but I want to see if this 
is common so
+       // I don't over-framework it.
+       var hasEditSection = $( '.mw-editsection' ).length > 0;
+
        gt.defineTour( {
                name: 'gettingstartedtasktoolbar',
                shouldLog: true,
@@ -32,15 +36,16 @@
                        width: 300,
                        shouldSkip: gt.isEditing,
                        buttons: [ {
-                               action: 'okay',
+                               namemsg: hasEditSection ? 
'guidedtour-next-button' : 'guidedtour-okay-button',
                                onclick: function () {
-                                       if ( $( '.mw-editsection' ).length > 0 
) {
+                                       if ( hasEditSection ) {
                                                mw.libs.guiders.next();
                                        } else {
                                                mw.libs.guiders.hideAll();
                                        }
                                }
-                       } ]
+                       } ],
+                       allowAutomaticOkay: false
                }, {
                        titlemsg: 
'guidedtour-tour-gettingstartedtasktoolbar-edit-section-title',
                        descriptionmsg: 
'guidedtour-tour-gettingstartedtasktoolbar-edit-section-description',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib357c9c3b680e6dc907b4cf95972684e627c0dff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GettingStarted
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>

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

Reply via email to