From 13f182c2f138c25b0b57169dc94ecbfdd59483ef Mon Sep 17 00:00:00 2001 From: Melissa Zhang Date: Wed, 22 Apr 2020 23:24:14 -0700 Subject: icons for clear buttons --- src/client/views/nodes/ComparisonBox.scss | 14 ++++++------ src/client/views/nodes/ComparisonBox.tsx | 38 ++++++++++++++++--------------- 2 files changed, 27 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/ComparisonBox.scss b/src/client/views/nodes/ComparisonBox.scss index 5112ed4b8..38d3a04e9 100644 --- a/src/client/views/nodes/ComparisonBox.scss +++ b/src/client/views/nodes/ComparisonBox.scss @@ -40,18 +40,18 @@ .clear-button { position: absolute; - top: 0; - height: 25px; - width: 25px; - background-color: white; - border-radius: 50%; + opacity: 1; + pointer-events: all; + cursor: pointer; } .clear-button.before { - left: 0; + top: 3px; + left: 3px; } .clear-button.after { - right: 0; + top: 3px; + right: 3px; } } \ No newline at end of file diff --git a/src/client/views/nodes/ComparisonBox.tsx b/src/client/views/nodes/ComparisonBox.tsx index fe3f47e2a..15ba8d8f2 100644 --- a/src/client/views/nodes/ComparisonBox.tsx +++ b/src/client/views/nodes/ComparisonBox.tsx @@ -1,6 +1,6 @@ import { library } from '@fortawesome/fontawesome-svg-core'; import { faEye } from '@fortawesome/free-regular-svg-icons'; -import { faAsterisk, faBrain, faFileAudio, faImage, faPaintBrush } from '@fortawesome/free-solid-svg-icons'; +import { faAsterisk, faBrain, faFileAudio, faImage, faPaintBrush, faTimes } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { action, computed, observable, runInAction } from 'mobx'; import { observer } from "mobx-react"; @@ -71,8 +71,8 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent { - const width = this.props.Document.clipWidth + movementX; - if (width && width > 0 && width < this.props.PanelWidth()) { + const width = NumCast(this.props.Document.clipWidth) + movementX; //is it ok to use NumCast + if (width && width > 5 && width < this.props.PanelWidth()) { this.props.Document.clipWidth = width; } } @@ -117,13 +117,14 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent { beforeDoc ? - <> -
this.clearBeforeDoc(e)} - /> + <> + +
this.clearBeforeDoc(e)}> + +
+ :
upload before image! @@ -141,15 +142,16 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent { afterDoc ? - <> -
this.clearAfterDoc(e)} - /> + <> + +
this.clearAfterDoc(e)}> + +
+ : -
+
upload after image!
} -- cgit v1.2.3-70-g09d2