From 22629ac09dbb54be2657ef16dbc5979a7093fd56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Tue, 7 Jul 2015 18:07:12 +0200 Subject: [PATCH] adjust register piece form --- js/components/ascribe_forms/property.js | 11 ++-- .../ascribe_uploader/file_drag_and_drop.js | 9 +++- .../file_drag_and_drop_dialog.js | 37 +++++++++++++ .../file_drag_and_drop_preview.js | 6 ++- js/components/register_piece.js | 23 ++++---- sass/ascribe_login.scss | 4 ++ sass/ascribe_uploader.scss | 53 ++++++++----------- 7 files changed, 92 insertions(+), 51 deletions(-) create mode 100644 js/components/ascribe_uploader/file_drag_and_drop_dialog.js diff --git a/js/components/ascribe_forms/property.js b/js/components/ascribe_forms/property.js index c4238675..df3df761 100644 --- a/js/components/ascribe_forms/property.js +++ b/js/components/ascribe_forms/property.js @@ -17,13 +17,14 @@ let Property = React.createClass({ React.PropTypes.element ]), footer: React.PropTypes.element, - handleChange: React.PropTypes.func + handleChange: React.PropTypes.func, + ignoreFocus: React.PropTypes.bool }, getDefaultProps() { return { editable: true, - hidden: false, + hidden: false }; }, @@ -62,6 +63,9 @@ let Property = React.createClass({ this.setState({value: event.target.value}); }, handleFocus() { + if(this.props.ignoreFocus) { + return; + } this.refs.input.getDOMNode().focus(); this.setState({ isFocused: true @@ -134,7 +138,8 @@ let Property = React.createClass({ return (
+ onClick={this.handleFocus} + onfocus={this.handleFocus}> - {hasFiles ? null : this.props.multiple ? Click or drag to add files : Click or drag to add a file} + Click or drag to add files + ); + } else { + return ( + +

Drag a file here

+

or

+ +
+ ); + } + } + } +}); + +export default FileDragAndDropDialog; \ No newline at end of file diff --git a/js/components/ascribe_uploader/file_drag_and_drop_preview.js b/js/components/ascribe_uploader/file_drag_and_drop_preview.js index fd392767..33f07383 100644 --- a/js/components/ascribe_uploader/file_drag_and_drop_preview.js +++ b/js/components/ascribe_uploader/file_drag_and_drop_preview.js @@ -72,7 +72,11 @@ let FileDragAndDropPreview = React.createClass({ if(this.props.areAssetsEditable) { removeBtn = (
-
); } diff --git a/js/components/register_piece.js b/js/components/register_piece.js index 45fe2aba..4ca74ea3 100644 --- a/js/components/register_piece.js +++ b/js/components/register_piece.js @@ -165,19 +165,8 @@ let RegisterPiece = React.createClass( { onClick={this.changeSlide} onFocus={this.changeSlide}> - -
- -
-
-
- - -

Lock down title

+ +

Register your work

}> - + + + diff --git a/sass/ascribe_login.scss b/sass/ascribe_login.scss index 392cde7f..9ff2857f 100644 --- a/sass/ascribe_login.scss +++ b/sass/ascribe_login.scss @@ -23,6 +23,10 @@ $break-small: 764px; background-color: rgba(2, 182, 163, 0.6); border: none; } + + &[disabled] { + opacity: .3; + } } .ascribe-btn-login-spinner{ diff --git a/sass/ascribe_uploader.scss b/sass/ascribe_uploader.scss index 062c0b49..debdf51a 100644 --- a/sass/ascribe_uploader.scss +++ b/sass/ascribe_uploader.scss @@ -1,7 +1,6 @@ .file-drag-and-drop { display: block; - outline: 1px dashed #616161; - cursor: pointer; + outline: 1px dashed #9E9E9E; vertical-align: middle; text-align: center; height: auto; @@ -9,43 +8,28 @@ overflow: auto; margin-top: 1em; - padding: 3em; + cursor: default !important; + + padding: 1.5em 1.5em 1.5em 0; } .inactive-dropzone { cursor: default !important; + background-color: rgba(0,0,0,0) !important; + outline: 0; } -.inactive-dropzone:hover { - background-color: #FAFAFA !important; -} +.file-drag-and-drop .file-drag-and-drop-dialog > p:first-child { + font-size: 1.5em !important; -.file-drag-and-drop:hover { - background-color: rgba(72, 218, 203, 0.2); -} - -.file-drag-and-drop .file-drag-and-drop-dialog { - font-size: 1.25em !important; - - margin-top: 1em; - - &::before { - content: ' '; - display: inline-block; - vertical-align: middle; /* vertical alignment of the inline element */ - height: 100%; - } -} - -.has-files { - text-align: left; - padding: 4% 0 0 0; + margin-top: 0; + margin-bottom: 0; + padding-bottom: 0; } .file-drag-and-drop-position { position: relative; display: inline-block; - margin: 0 0 4% 4%; float:left; .delete-file { @@ -64,14 +48,21 @@ span { color: white; + top: 1; + left: 0; + font-size: .8em; + + &:hover { + color: $brand-danger; + } } } } .file-drag-and-drop-preview-table-wrapper { display: table; - height:64px; - width:74px; + height:74px; + width:84px; } .file-drag-and-drop-preview { @@ -83,8 +74,8 @@ .file-drag-and-drop-preview-image { display: table; - height:74px; - width:74px; + height:84px; + width:84px; overflow:hidden; border: 1px solid #616161; text-align: center;