From ca3856ab3b7d47b42b46db176c6678a24c1fc402 Mon Sep 17 00:00:00 2001
From: Florian Orben <florian.orben@gmail.com>
Date: Tue, 17 Nov 2015 19:01:26 +0100
Subject: move preview-link-toggle outside of component markup

---
 web/react/components/textbox.jsx | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

(limited to 'web/react/components/textbox.jsx')

diff --git a/web/react/components/textbox.jsx b/web/react/components/textbox.jsx
index e2868e946..1e9e912a8 100644
--- a/web/react/components/textbox.jsx
+++ b/web/react/components/textbox.jsx
@@ -303,7 +303,19 @@ export default class Textbox extends React.Component {
     }
 
     render() {
-        const previewLinkVisible = this.props.messageText.length > 0;
+        let previewLink = null;
+        if (Utils.featureToggle('#1389')) {
+            const previewLinkVisible = this.props.messageText.length > 0;
+            previewLink = (
+                <a
+                    style={{visibility: previewLinkVisible ? 'visible' : 'hidden'}}
+                    onClick={this.showPreview}
+                    className='textbox-preview-link'
+                >
+                    {this.state.preview ? 'Edit message' : 'Preview'}
+                </a>
+            );
+        }
 
         return (
             <div
@@ -342,19 +354,13 @@ export default class Textbox extends React.Component {
                     dangerouslySetInnerHTML={{__html: this.state.preview ? TextFormatting.formatText(this.props.messageText) : ''}}
                 >
                 </div>
+                {previewLink}
                 <a
                     onClick={this.showHelp}
                     className='textbox-help-link'
                 >
                     {'Help'}
                 </a>
-                <a
-                    style={{visibility: previewLinkVisible ? 'visible' : 'hidden'}}
-                    onClick={this.showPreview}
-                    className='textbox-preview-link'
-                >
-                    {this.state.preview ? 'Edit' : 'Preview'}
-                </a>
             </div>
         );
     }
-- 
cgit v1.2.3-1-g7c22

