Mattflaschen has uploaded a new change for review.

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

Change subject: Fix topic creation on mobile
......................................................................

Fix topic creation on mobile

There is code to only save the 'flow-editor' preference on-change
if the user's old preferred editor is available.

This means it won't get forced to 'wikitext' on mobile (where VE isn't
available).  However, we should still emit the 'change' event,
since the meaning of the EditorSwitcherWidget 'change' event is:

"The contents of the editor changed."

This allows the topic creation button to un-disable.

Bug: T134060
Change-Id: I877b09c3d015a40aa01405ab3efc5bd088203d9f
(cherry picked from commit 292ff27a84aff04f1f33d881a2033835879dcc78)
---
M modules/flow/ui/widgets/editor/mw.flow.ui.EditorSwitcherWidget.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/27/286527/1

diff --git a/modules/flow/ui/widgets/editor/mw.flow.ui.EditorSwitcherWidget.js 
b/modules/flow/ui/widgets/editor/mw.flow.ui.EditorSwitcherWidget.js
index 7971194..1edd1ff 100644
--- a/modules/flow/ui/widgets/editor/mw.flow.ui.EditorSwitcherWidget.js
+++ b/modules/flow/ui/widgets/editor/mw.flow.ui.EditorSwitcherWidget.js
@@ -446,6 +446,8 @@
                        return;
                }
 
+               this.emit( 'change' );
+
                // Normalize 'none' to 'wikitext'
                if ( currentPref === 'none' ) {
                        currentPref = 'wikitext';
@@ -467,8 +469,6 @@
                        // Ensure we also see that preference in the current 
page
                        mw.user.options.set( 'flow-editor', name );
                }
-
-               this.emit( 'change' );
        };
 
        /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I877b09c3d015a40aa01405ab3efc5bd088203d9f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: wmf/1.27.0-wmf.22
Gerrit-Owner: Mattflaschen <[email protected]>

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

Reply via email to