jenkins-bot has submitted this change and it was merged.
Change subject: Add flow-ui-focused class to wikitext editor when textarea has
focus
......................................................................
Add flow-ui-focused class to wikitext editor when textarea has focus
Needed so we can style the entire editor when it's focused,
similar to VE.
Change-Id: I4de896974dd02a794501d44d327693ba270249b2
---
M modules/editor/editors/ext.flow.editors.none.js
1 file changed, 14 insertions(+), 0 deletions(-)
Approvals:
Mooeypoo: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/editor/editors/ext.flow.editors.none.js
b/modules/editor/editors/ext.flow.editors.none.js
index 992205f..8d95f5d 100644
--- a/modules/editor/editors/ext.flow.editors.none.js
+++ b/modules/editor/editors/ext.flow.editors.none.js
@@ -11,6 +11,7 @@
* @param {string} [content='']
*/
mw.flow.editors.none = function ( $node, content ) {
+ var $editor = $node.closest( '.flow-editor' );
this.$node = $node;
this.$node.val( content || '' );
@@ -24,6 +25,19 @@
this.$node.keyup( this.autoExpand );
this.autoExpand.call( this.$node.get( 0 ) );
+ // Add focused class when textarea is focused
+ this.$node
+ .on( 'focus', function () {
+ $editor.addClass( 'flow-ui-focused' );
+ } )
+ .on( 'blur', function () {
+ $editor.removeClass( 'flow-ui-focused' );
+ } );
+ // Add focused class if textarea is already focused
+ if ( this.$node.is( ':focus' ) ) {
+ $editor.addClass( 'flow-ui-focused' );
+ }
+
// only attach switcher if VE is actually enabled and supported
// code to figure out if that VE is supported is in that module
if ( mw.config.get( 'wgFlowEditorList' ).indexOf(
'visualeditor' ) !== -1 ) {
--
To view, visit https://gerrit.wikimedia.org/r/207000
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4de896974dd02a794501d44d327693ba270249b2
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Mooeypoo <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits