mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
styling for mobile
This commit is contained in:
parent
867ebec134
commit
dcb3e00e3a
@ -109,9 +109,9 @@ var FileDragAndDrop = React.createClass({
|
|||||||
render: function () {
|
render: function () {
|
||||||
// has files only is true if there are files that do not have the status deleted or canceled
|
// has files only is true if there are files that do not have the status deleted or canceled
|
||||||
let hasFiles = this.props.filesToUpload.filter((file) => file.status !== 'deleted' && file.status !== 'canceled').length > 0;
|
let hasFiles = this.props.filesToUpload.filter((file) => file.status !== 'deleted' && file.status !== 'canceled').length > 0;
|
||||||
let className = hasFiles ? 'file-drag-and-drop has-files ' : 'file-drag-and-drop ';
|
let className = hasFiles ? 'has-files ' : '';
|
||||||
className += this.props.dropzoneInactive ? 'inactive-dropzone' : 'active-dropzone';
|
className += this.props.dropzoneInactive ? 'inactive-dropzone' : 'active-dropzone';
|
||||||
className += ' ' + this.props.className;
|
className += this.props.className ? ' ' + this.props.className : '';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ProgressBar from 'react-progressbar';
|
import ProgressBar from 'react-progressbar';
|
||||||
|
|
||||||
|
import AppConstants from '../../constants/application_constants';
|
||||||
|
|
||||||
let FileDragAndDropPreviewImage = React.createClass({
|
let FileDragAndDropPreviewImage = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
progress: React.PropTypes.number,
|
progress: React.PropTypes.number,
|
||||||
@ -10,23 +12,33 @@ let FileDragAndDropPreviewImage = React.createClass({
|
|||||||
onClick: React.PropTypes.func
|
onClick: React.PropTypes.func
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getInitialState() {
|
||||||
|
return {
|
||||||
|
loading: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
onClick(e) {
|
||||||
|
this.setState({
|
||||||
|
loading: true
|
||||||
|
});
|
||||||
|
|
||||||
|
this.props.onClick(e);
|
||||||
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let imageStyle = {
|
let imageStyle = {
|
||||||
backgroundImage: 'url("' + this.props.url + '")',
|
backgroundImage: 'url("' + this.props.url + '")',
|
||||||
backgroundSize: 'cover'
|
backgroundSize: 'cover'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let actionSymbol = this.state.loading ? <img src={AppConstants.baseUrl + 'static/img/ascribe_animated_medium.gif'} /> : <span className="glyphicon glyphicon-remove delete-file" aria-hidden="true" title="Delete or cancel upload" onClick={this.onClick} />;
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="file-drag-and-drop-preview-image"
|
className="file-drag-and-drop-preview-image"
|
||||||
style={imageStyle}>
|
style={imageStyle}>
|
||||||
<ProgressBar completed={this.props.progress} color="black"/>
|
<ProgressBar completed={this.props.progress} color="black"/>
|
||||||
<span
|
{actionSymbol}
|
||||||
className="glyphicon glyphicon-remove delete-file"
|
|
||||||
aria-hidden="true"
|
|
||||||
title="Delete"
|
|
||||||
onClick={this.props.onClick}>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ var ReactS3FineUploader = React.createClass({
|
|||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
},
|
},
|
||||||
multiple: false
|
multiple: true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -425,6 +425,7 @@ var ReactS3FineUploader = React.createClass({
|
|||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<FileDragAndDrop
|
<FileDragAndDrop
|
||||||
|
className="file-drag-and-drop"
|
||||||
onDrop={this.handleUploadFile}
|
onDrop={this.handleUploadFile}
|
||||||
filesToUpload={this.state.filesToUpload}
|
filesToUpload={this.state.filesToUpload}
|
||||||
handleDeleteFile={this.handleDeleteFile}
|
handleDeleteFile={this.handleDeleteFile}
|
||||||
|
@ -72,9 +72,10 @@
|
|||||||
|
|
||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
|
|
||||||
/* input, div, span, pre, textarea, select {
|
input, div, span:not(.glyphicon), pre, textarea, select {
|
||||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
} */
|
}
|
||||||
|
|
||||||
span {
|
span {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
@ -83,7 +84,7 @@
|
|||||||
|
|
||||||
div {
|
div {
|
||||||
/* margin-top: 10px; */
|
/* margin-top: 10px; */
|
||||||
div {
|
div:not(.file-drag-and-drop div) {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
.file-drag-and-drop {
|
.file-drag-and-drop {
|
||||||
position: relative;
|
|
||||||
display: block;
|
display: block;
|
||||||
outline: 1px dashed #616161;
|
outline: 1px dashed #616161;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
height:185px;
|
height: auto;
|
||||||
background-color: #FAFAFA;
|
background-color: #FAFAFA;
|
||||||
transition: .1s linear background-color;
|
overflow: auto;
|
||||||
|
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
|
|
||||||
|
padding: 3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inactive-dropzone {
|
.inactive-dropzone {
|
||||||
@ -27,6 +27,8 @@
|
|||||||
.file-drag-and-drop .file-drag-and-drop-dialog {
|
.file-drag-and-drop .file-drag-and-drop-dialog {
|
||||||
font-size: 1.25em !important;
|
font-size: 1.25em !important;
|
||||||
|
|
||||||
|
margin-top: 1em;
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
content: ' ';
|
content: ' ';
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@ -37,19 +39,19 @@
|
|||||||
|
|
||||||
.has-files {
|
.has-files {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding: 3em 0 0 0;
|
padding: 4% 0 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-drag-and-drop-position {
|
.file-drag-and-drop-position {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin: 0 0 3em 3em;
|
margin: 0 0 4% 4%;
|
||||||
float:left;
|
float:left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-drag-and-drop-preview-table-wrapper {
|
.file-drag-and-drop-preview-table-wrapper {
|
||||||
display: table;
|
display: table;
|
||||||
height:94px;
|
height:64px;
|
||||||
width:104px;
|
width:74px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-drag-and-drop-preview {
|
.file-drag-and-drop-preview {
|
||||||
@ -61,15 +63,15 @@
|
|||||||
|
|
||||||
.file-drag-and-drop-preview-image {
|
.file-drag-and-drop-preview-image {
|
||||||
display: table;
|
display: table;
|
||||||
height:104px;
|
height:74px;
|
||||||
width:104px;
|
width:74px;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
border: 1px solid #616161;
|
border: 1px solid #616161;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-drag-and-drop-preview-image .delete-file {
|
.file-drag-and-drop-preview-image .delete-file {
|
||||||
font-size: 3em;
|
font-size: 2.5em;
|
||||||
margin-top: .3em;
|
margin-top: .3em;
|
||||||
color: white;
|
color: white;
|
||||||
text-shadow: -2px 0 black, 0 2px black, 2px 0 black, 0 -2px black;
|
text-shadow: -2px 0 black, 0 2px black, 2px 0 black, 0 -2px black;
|
||||||
@ -82,9 +84,9 @@
|
|||||||
|
|
||||||
.file-drag-and-drop-preview-other .delete-file {
|
.file-drag-and-drop-preview-other .delete-file {
|
||||||
position: relative;
|
position: relative;
|
||||||
top: .45em;
|
top: .3em;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
font-size: 3em;
|
font-size: 2.5em;
|
||||||
color: white;
|
color: white;
|
||||||
text-shadow: -2px 0 black, 0 2px black, 2px 0 black, 0 -2px black;
|
text-shadow: -2px 0 black, 0 2px black, 2px 0 black, 0 -2px black;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@ -103,5 +105,5 @@
|
|||||||
|
|
||||||
.file-drag-and-drop-preview-other span:not(:first-child) {
|
.file-drag-and-drop-preview-other span:not(:first-child) {
|
||||||
display: block;
|
display: block;
|
||||||
margin-top: 1.5em;
|
margin-top: .5em;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user