summaryrefslogtreecommitdiffstats
path: root/dox-sequence-diagram-ui/src/main/webapp/lib/ecomp/asdc/sequencer/components/editor/Editor.jsx
diff options
context:
space:
mode:
authorEinav Weiss Keidar <einavw@amdocs.com>2018-03-20 14:45:40 +0200
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-03-20 13:52:31 +0000
commit7fdf733a64670fceefc3ded35cfa581e1c458179 (patch)
treeb3623ac9a331473830cb0167c0b487f2a176427c /dox-sequence-diagram-ui/src/main/webapp/lib/ecomp/asdc/sequencer/components/editor/Editor.jsx
parentc7916a4e5955ccc5f0f5252307363b791ec5c7b9 (diff)
Adding Prettier and fixing up eslint version
Issue-ID: SDC-1094 Change-Id: Ie83ad95a03899345dd90235daf0323cbe3bc6afd Signed-off-by: Einav Weiss Keidar <einavw@amdocs.com>
Diffstat (limited to 'dox-sequence-diagram-ui/src/main/webapp/lib/ecomp/asdc/sequencer/components/editor/Editor.jsx')
-rw-r--r--dox-sequence-diagram-ui/src/main/webapp/lib/ecomp/asdc/sequencer/components/editor/Editor.jsx248
1 files changed, 123 insertions, 125 deletions
diff --git a/dox-sequence-diagram-ui/src/main/webapp/lib/ecomp/asdc/sequencer/components/editor/Editor.jsx b/dox-sequence-diagram-ui/src/main/webapp/lib/ecomp/asdc/sequencer/components/editor/Editor.jsx
index 00c8f7c47c..087bc8029f 100644
--- a/dox-sequence-diagram-ui/src/main/webapp/lib/ecomp/asdc/sequencer/components/editor/Editor.jsx
+++ b/dox-sequence-diagram-ui/src/main/webapp/lib/ecomp/asdc/sequencer/components/editor/Editor.jsx
@@ -26,149 +26,147 @@ import Source from './components/source/Source';
* Editor view, aggregating the designer, the code editor, the toolbar.
*/
class Editor extends React.Component {
+ // ///////////////////////////////////////////////////////////////////////////////////////////////
- // ///////////////////////////////////////////////////////////////////////////////////////////////
+ /**
+ * Construct React view.
+ * @param props properties.
+ * @param context context.
+ */
+ constructor(props, context) {
+ super(props, context);
- /**
- * Construct React view.
- * @param props properties.
- * @param context context.
- */
- constructor(props, context) {
- super(props, context);
+ this.application = Common.assertNotNull(props.application);
+ this.demo = this.application.getOptions().demo;
- this.application = Common.assertNotNull(props.application);
- this.demo = this.application.getOptions().demo;
+ // Bindings.
- // Bindings.
+ this.selectMessage = this.selectMessage.bind(this);
+ this.selectLifeline = this.selectLifeline.bind(this);
- this.selectMessage = this.selectMessage.bind(this);
- this.selectLifeline = this.selectLifeline.bind(this);
-
- this.onMouseDown = this.onMouseDown.bind(this);
- this.onMouseUp = this.onMouseUp.bind(this);
- this.onMouseMove = this.onMouseMove.bind(this);
- }
+ this.onMouseDown = this.onMouseDown.bind(this);
+ this.onMouseUp = this.onMouseUp.bind(this);
+ this.onMouseMove = this.onMouseMove.bind(this);
+ }
- // ///////////////////////////////////////////////////////////////////////////////////////////////
+ // ///////////////////////////////////////////////////////////////////////////////////////////////
- /**
- * Select message by ID.
- * @param id message ID.
- */
- selectMessage(id) {
- if (this.designer) {
- this.designer.selectMessage(id);
+ /**
+ * Select message by ID.
+ * @param id message ID.
+ */
+ selectMessage(id) {
+ if (this.designer) {
+ this.designer.selectMessage(id);
+ }
}
- }
- // ///////////////////////////////////////////////////////////////////////////////////////////////
+ // ///////////////////////////////////////////////////////////////////////////////////////////////
- /**
- * Select lifeline by ID.
- * @param id lifeline ID.
- */
- selectLifeline(id) {
- if (this.designer) {
- this.designer.selectLifeline(id);
+ /**
+ * Select lifeline by ID.
+ * @param id lifeline ID.
+ */
+ selectLifeline(id) {
+ if (this.designer) {
+ this.designer.selectLifeline(id);
+ }
}
- }
-
- // ///////////////////////////////////////////////////////////////////////////////////////////////
-
- /**
- * Record that we're dragging.
- */
- onMouseDown() {
- if (this.editor) {
- this.resize = {
- initialWidth: this.editor.offsetWidth,
- initialPageX: undefined,
- };
+
+ // ///////////////////////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Record that we're dragging.
+ */
+ onMouseDown() {
+ if (this.editor) {
+ this.resize = {
+ initialWidth: this.editor.offsetWidth,
+ initialPageX: undefined
+ };
+ }
}
- }
-
- // ///////////////////////////////////////////////////////////////////////////////////////////////
-
- /**
- * Record that we're not dragging.
- */
- onMouseUp() {
- this.resize = undefined;
- }
-
- // ///////////////////////////////////////////////////////////////////////////////////////////////
-
- /**
- * Record mouse movement.
- */
- onMouseMove(event) {
- if (this.resize) {
- if (this.editor) {
- if (this.resize.initialPageX) {
- const deltaX = event.pageX - this.resize.initialPageX;
- const newWidth = this.resize.initialWidth + deltaX;
- const newWidthBounded = Math.min(800, Math.max(400, newWidth));
- this.editor.style.width = `${newWidthBounded}px`;
- } else {
- this.resize.initialPageX = event.pageX;
+
+ // ///////////////////////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Record that we're not dragging.
+ */
+ onMouseUp() {
+ this.resize = undefined;
+ }
+
+ // ///////////////////////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Record mouse movement.
+ */
+ onMouseMove(event) {
+ if (this.resize) {
+ if (this.editor) {
+ if (this.resize.initialPageX) {
+ const deltaX = event.pageX - this.resize.initialPageX;
+ const newWidth = this.resize.initialWidth + deltaX;
+ const newWidthBounded = Math.min(
+ 800,
+ Math.max(400, newWidth)
+ );
+ this.editor.style.width = `${newWidthBounded}px`;
+ } else {
+ this.resize.initialPageX = event.pageX;
+ }
+ }
}
- }
}
- }
-
- // ///////////////////////////////////////////////////////////////////////////////////////////////
-
- /**
- * Render editor.
- */
- render() {
-
- Logger.info('Editor.jsx - render()');
-
- return (
-
- <div
- className="asdcs-editor"
- ref={(r) => { this.editor = r; }}
- >
-
- <Toolbar application={this.props.application} editor={this} />
-
- <div className="asdcs-editor-content">
- <Source application={this.props.application} />
- <Designer
- application={this.props.application}
- ref={(r) => {
- if (r) {
- this.designer = r.getDecoratedComponentInstance();
- } else {
- this.designer = null;
- }
- }}
- />
- </div>
-
- <div className="asdcs-editor-statusbar">
- <div className="asdcs-editor-status"></div>
- <div className="asdcs-editor-validation"></div>
- </div>
-
- <div
- className="asdcs-editor-resize-handle"
- onMouseDown={this.onMouseDown}
- onMouseUp={this.onMouseUp}
- >
- </div>
- </div>
- );
- }
+
+ // ///////////////////////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Render editor.
+ */
+ render() {
+ Logger.info('Editor.jsx - render()');
+
+ return (
+ <div
+ className="asdcs-editor"
+ ref={r => {
+ this.editor = r;
+ }}>
+ <Toolbar application={this.props.application} editor={this} />
+
+ <div className="asdcs-editor-content">
+ <Source application={this.props.application} />
+ <Designer
+ application={this.props.application}
+ ref={r => {
+ if (r) {
+ this.designer = r.getDecoratedComponentInstance();
+ } else {
+ this.designer = null;
+ }
+ }}
+ />
+ </div>
+
+ <div className="asdcs-editor-statusbar">
+ <div className="asdcs-editor-status" />
+ <div className="asdcs-editor-validation" />
+ </div>
+
+ <div
+ className="asdcs-editor-resize-handle"
+ onMouseDown={this.onMouseDown}
+ onMouseUp={this.onMouseUp}
+ />
+ </div>
+ );
+ }
}
/** Element properties. */
Editor.propTypes = {
- application: PropTypes.object.isRequired,
+ application: PropTypes.object.isRequired
};
export default Editor;
-