mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
separate FileDragAndDrop component
This commit is contained in:
parent
8b1193f05b
commit
c08f46bd69
@ -6,7 +6,7 @@ import ProgressBar from 'react-progressbar';
|
|||||||
import FileDragAndDropDialog from './file_drag_and_drop_dialog';
|
import FileDragAndDropDialog from './file_drag_and_drop_dialog';
|
||||||
import FileDragAndDropPreviewIterator from './file_drag_and_drop_preview_iterator';
|
import FileDragAndDropPreviewIterator from './file_drag_and_drop_preview_iterator';
|
||||||
|
|
||||||
import { getLangText } from '../../utils/lang_utils';
|
import { getLangText } from '../../../utils/lang_utils';
|
||||||
|
|
||||||
// Taken from: https://github.com/fedosejev/react-file-drag-and-drop
|
// Taken from: https://github.com/fedosejev/react-file-drag-and-drop
|
||||||
let FileDragAndDrop = React.createClass({
|
let FileDragAndDrop = React.createClass({
|
||||||
@ -189,7 +189,7 @@ let FileDragAndDrop = React.createClass({
|
|||||||
let hasFiles = filesToUpload.filter((file) => file.status !== 'deleted' && file.status !== 'canceled' && file.size !== -1).length > 0;
|
let hasFiles = filesToUpload.filter((file) => file.status !== 'deleted' && file.status !== 'canceled' && file.size !== -1).length > 0;
|
||||||
let updatedClassName = hasFiles ? 'has-files ' : '';
|
let updatedClassName = hasFiles ? 'has-files ' : '';
|
||||||
updatedClassName += dropzoneInactive ? 'inactive-dropzone' : 'active-dropzone';
|
updatedClassName += dropzoneInactive ? 'inactive-dropzone' : 'active-dropzone';
|
||||||
updatedClassName += className ? ' ' + className : '';
|
updatedClassName += ' file-drag-and-drop';
|
||||||
|
|
||||||
// if !== -2: triggers a FileDragAndDrop-global spinner
|
// if !== -2: triggers a FileDragAndDrop-global spinner
|
||||||
if(hashingProgress !== -2) {
|
if(hashingProgress !== -2) {
|
@ -3,7 +3,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Router from 'react-router';
|
import Router from 'react-router';
|
||||||
|
|
||||||
import { getLangText } from '../../utils/lang_utils';
|
import { getLangText } from '../../../utils/lang_utils';
|
||||||
|
|
||||||
let Link = Router.Link;
|
let Link = Router.Link;
|
||||||
|
|
@ -4,7 +4,7 @@ import React from 'react';
|
|||||||
|
|
||||||
import FileDragAndDropPreviewImage from './file_drag_and_drop_preview_image';
|
import FileDragAndDropPreviewImage from './file_drag_and_drop_preview_image';
|
||||||
import FileDragAndDropPreviewOther from './file_drag_and_drop_preview_other';
|
import FileDragAndDropPreviewOther from './file_drag_and_drop_preview_other';
|
||||||
import { getLangText } from '../../utils/lang_utils.js';
|
import { getLangText } from '../../../utils/lang_utils';
|
||||||
|
|
||||||
let FileDragAndDropPreview = React.createClass({
|
let FileDragAndDropPreview = React.createClass({
|
||||||
|
|
@ -3,8 +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';
|
import AppConstants from '../../../constants/application_constants';
|
||||||
import { getLangText } from '../../utils/lang_utils.js';
|
import { getLangText } from '../../../utils/lang_utils';
|
||||||
|
|
||||||
let FileDragAndDropPreviewImage = React.createClass({
|
let FileDragAndDropPreviewImage = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
@ -3,8 +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';
|
import AppConstants from '../../../constants/application_constants';
|
||||||
import { getLangText } from '../../utils/lang_utils.js';
|
import { getLangText } from '../../../utils/lang_utils';
|
||||||
|
|
||||||
let FileDragAndDropPreviewOther = React.createClass({
|
let FileDragAndDropPreviewOther = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
@ -10,7 +10,7 @@ import { getLangText } from '../../utils/lang_utils';
|
|||||||
import S3Fetcher from '../../fetchers/s3_fetcher';
|
import S3Fetcher from '../../fetchers/s3_fetcher';
|
||||||
|
|
||||||
import fineUploader from 'fineUploader';
|
import fineUploader from 'fineUploader';
|
||||||
import FileDragAndDrop from './file_drag_and_drop';
|
import FileDragAndDrop from './ascribe_file_drag_and_drop/file_drag_and_drop';
|
||||||
|
|
||||||
import GlobalNotificationModel from '../../models/global_notification_model';
|
import GlobalNotificationModel from '../../models/global_notification_model';
|
||||||
import GlobalNotificationActions from '../../actions/global_notification_actions';
|
import GlobalNotificationActions from '../../actions/global_notification_actions';
|
||||||
@ -842,7 +842,6 @@ var ReactS3FineUploader = React.createClass({
|
|||||||
// Here we initialize the template that has been either provided from the outside
|
// Here we initialize the template that has been either provided from the outside
|
||||||
// or the default input that is FileDragAndDrop.
|
// or the default input that is FileDragAndDrop.
|
||||||
return React.createElement(fileInputElement, {
|
return React.createElement(fileInputElement, {
|
||||||
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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user