[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Follow-up c1beac48: fix JS error when clicking reply link

2017-04-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/350331 )

Change subject: Follow-up c1beac48: fix JS error when clicking reply link
..


Follow-up c1beac48: fix JS error when clicking reply link

The constructor called this.initializeEditor() before
this.$editorContainer was set, which caused a JS error
in non-expandable mode.

Fix this by moving the code that deals with this stuff
all the way to the bottom of the constructor, so that everything
is definitely in good shape when initializeEditor() is called.

Bug: T163749
Change-Id: I4cb4e60aa859214a718b13e825d4a0a998e118f2
---
M modules/flow/ui/widgets/mw.flow.ui.ReplyWidget.js
1 file changed, 14 insertions(+), 15 deletions(-)

Approvals:
  jenkins-bot: Verified
  Mooeypoo: Looks good to me, approved



diff --git a/modules/flow/ui/widgets/mw.flow.ui.ReplyWidget.js 
b/modules/flow/ui/widgets/mw.flow.ui.ReplyWidget.js
index ffebbd8..75ed555 100644
--- a/modules/flow/ui/widgets/mw.flow.ui.ReplyWidget.js
+++ b/modules/flow/ui/widgets/mw.flow.ui.ReplyWidget.js
@@ -26,21 +26,6 @@
// Parent constructor
mw.flow.ui.ReplyWidget.parent.call( this, config );
 
-   if ( this.expandable ) {
-   this.triggerInput = new OO.ui.TextInputWidget( {
-   multiline: false,
-   classes: [ 'flow-ui-replyWidget-trigger-input' 
],
-   placeholder: config.placeholder
-   } );
-   this.triggerInput.$element.on( 'focusin', 
this.onTriggerFocusIn.bind( this ) );
-   this.$element.append( this.triggerInput.$element );
-   } else {
-   // Only initialize the editor if we are not in 
'expandable' mode
-   // Otherwise, the editor is lazy-loaded
-   this.initializeEditor();
-   this.editor.toggle( true );
-   }
-
this.api = new mw.flow.dm.APIHandler();
 
this.anonWarning = new mw.flow.ui.AnonWarningWidget( {
@@ -78,6 +63,20 @@
this.$editorContainer
);
 
+   if ( this.expandable ) {
+   this.triggerInput = new OO.ui.TextInputWidget( {
+   multiline: false,
+   classes: [ 'flow-ui-replyWidget-trigger-input' 
],
+   placeholder: config.placeholder
+   } );
+   this.triggerInput.$element.on( 'focusin', 
this.onTriggerFocusIn.bind( this ) );
+   this.$element.append( this.triggerInput.$element );
+   } else {
+   // Only initialize the editor if we are not in 
'expandable' mode
+   // Otherwise, the editor is lazy-loaded
+   this.initializeEditor();
+   this.editor.toggle( true );
+   }
};
 
/* Initialization */

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4cb4e60aa859214a718b13e825d4a0a998e118f2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Catrope 
Gerrit-Reviewer: Mooeypoo 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Follow-up c1beac48: fix JS error when clicking reply link

2017-04-25 Thread Catrope (Code Review)
Catrope has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/350331 )

Change subject: Follow-up c1beac48: fix JS error when clicking reply link
..

Follow-up c1beac48: fix JS error when clicking reply link

The constructor called this.initializeEditor() before
this.$editorContainer was set, which caused a JS error
in non-expandable mode.

Fix this by moving the code that deals with this stuff
all the way to the bottom of the constructor, so that everything
is definitely in good shape when initializeEditor() is called.

Bug: T163749
Change-Id: I4cb4e60aa859214a718b13e825d4a0a998e118f2
---
M modules/flow/ui/widgets/mw.flow.ui.ReplyWidget.js
1 file changed, 14 insertions(+), 15 deletions(-)


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

diff --git a/modules/flow/ui/widgets/mw.flow.ui.ReplyWidget.js 
b/modules/flow/ui/widgets/mw.flow.ui.ReplyWidget.js
index ffebbd8..75ed555 100644
--- a/modules/flow/ui/widgets/mw.flow.ui.ReplyWidget.js
+++ b/modules/flow/ui/widgets/mw.flow.ui.ReplyWidget.js
@@ -26,21 +26,6 @@
// Parent constructor
mw.flow.ui.ReplyWidget.parent.call( this, config );
 
-   if ( this.expandable ) {
-   this.triggerInput = new OO.ui.TextInputWidget( {
-   multiline: false,
-   classes: [ 'flow-ui-replyWidget-trigger-input' 
],
-   placeholder: config.placeholder
-   } );
-   this.triggerInput.$element.on( 'focusin', 
this.onTriggerFocusIn.bind( this ) );
-   this.$element.append( this.triggerInput.$element );
-   } else {
-   // Only initialize the editor if we are not in 
'expandable' mode
-   // Otherwise, the editor is lazy-loaded
-   this.initializeEditor();
-   this.editor.toggle( true );
-   }
-
this.api = new mw.flow.dm.APIHandler();
 
this.anonWarning = new mw.flow.ui.AnonWarningWidget( {
@@ -78,6 +63,20 @@
this.$editorContainer
);
 
+   if ( this.expandable ) {
+   this.triggerInput = new OO.ui.TextInputWidget( {
+   multiline: false,
+   classes: [ 'flow-ui-replyWidget-trigger-input' 
],
+   placeholder: config.placeholder
+   } );
+   this.triggerInput.$element.on( 'focusin', 
this.onTriggerFocusIn.bind( this ) );
+   this.$element.append( this.triggerInput.$element );
+   } else {
+   // Only initialize the editor if we are not in 
'expandable' mode
+   // Otherwise, the editor is lazy-loaded
+   this.initializeEditor();
+   this.editor.toggle( true );
+   }
};
 
/* Initialization */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4cb4e60aa859214a718b13e825d4a0a998e118f2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Catrope 

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