Commit 34616050 authored by Primsi's avatar Primsi
Browse files

Issue #2696915 by yongt9412, dagmar, Nenad, Dragan Eror, miro_dietiker,...

Issue #2696915 by yongt9412, dagmar, Nenad, Dragan Eror, miro_dietiker, slashrsm, Primsi: Checkmark indicator for upload screen
parent e28bb330
/**
* @file file_browser.dropzone.css
*/
.dropzone .dz-preview .dropzonejs-remove-icon {
width: 24px;
height: 24px;
cursor: pointer;
position: absolute;
top: -8px;
right: -8px;
z-index: 500;
background-image: url("../icons/remove.svg");
background-size: cover;
}
.dropzone .dz-preview .dropzonejs-remove-icon:hover {
background-image: url("../icons/remove-hover.svg");
background-size: cover;
}
.dropzone .dz-preview.dz-file-preview .dz-image, .dropzone .dz-preview .dz-image {
border-radius: 0;
}
\ No newline at end of file
......@@ -11,6 +11,11 @@ dropzonejs:
css:
component:
/libraries/dropzone/dist/min/dropzone.min.css: {}
widget:
version: VERSION
css:
theme:
css/dropzone.widget.css: {}
integration:
version: VERSION
js:
......
<svg width="105" height="105" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<g>
<title>Layer 1</title>
<circle opacity="0.3" filter="url(#svg_3_blur)" r="51.5" cy="52.7" cx="52.49244" fill="#7f7f7f" id="svg_3"/>
<circle opacity="0.7" id="svg_1" r="50" cy="50.7" cx="52.49244" fill="#ca1000"/>
<rect transform="rotate(-45 52.49243927001951,50.70000457763671) " stroke="null" id="svg_5" height="15" width="63" y="43.2" x="20.99244" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="null" fill="#ffffff"/>
<rect transform="rotate(45 52.49243927001953,50.70000076293945) " id="svg_7" stroke="null" height="15" width="63" y="43.2" x="20.99244" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="null" fill="#ffffff"/>
</g>
<defs>
<filter id="svg_3_blur" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur stdDeviation="1.8"/>
</filter>
</defs>
<filter id="drop-shadow">
<feGaussianBlur stdDeviation="2.2"/>
</filter>
</svg>
\ No newline at end of file
<svg width="105" height="105" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<g>
<title>Layer 1</title>
<circle opacity="0.3" filter="url(#svg_3_blur)" r="51.5" cy="52.7" cx="52.49244" fill="#7f7f7f" id="svg_3"/>
<circle opacity="0.7" id="svg_1" r="50" cy="50.7" cx="52.49244" fill="#ffffff"/>
<rect transform="rotate(-45 52.49243927001951,50.70000457763671) " stroke="null" id="svg_5" height="15" width="63" y="43.2" x="20.99244" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="null" fill="#3f3f3f"/>
<rect transform="rotate(45 52.49243927001953,50.70000076293945) " id="svg_7" stroke="null" height="15" width="63" y="43.2" x="20.99244" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="null" fill="#3f3f3f"/>
</g>
<defs>
<filter id="svg_3_blur" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur stdDeviation="1.8"/>
</filter>
</defs>
<filter id="drop-shadow">
<feGaussianBlur stdDeviation="2.2"/>
</filter>
</svg>
\ No newline at end of file
......@@ -21,7 +21,7 @@
// Initiate dropzonejs.
var config = {
url: input.attr('data-upload-path'),
addRemoveLinks: true
addRemoveLinks: false
};
var instanceConfig = drupalSettings.dropzonejs.instances[selector.attr('id')];
if (instanceConfig.instance !== undefined) {
......@@ -32,6 +32,14 @@
// Other modules might need instances.
drupalSettings["dropzonejs"]["instances"][selector.attr("id")]["instance"] = dropzoneInstance;
dropzoneInstance.on("addedfile", function (file) {
file._removeIcon = Dropzone.createElement("<div class='dropzonejs-remove-icon' title='Remove'></div>");
file.previewElement.appendChild(file._removeIcon);
file._removeIcon.addEventListener("click", function () {
dropzoneInstance.removeFile(file);
});
});
// React on add file. Add only accepted files.
dropzoneInstance.on("success", function (file, response) {
var uploadedFilesElement = selector.siblings(':hidden');
......
......@@ -127,6 +127,7 @@ class DropzoneJsEbWidget extends WidgetBase {
'#extensions' => $config['settings']['extensions'],
];
$form['#attached']['library'][] = 'dropzonejs/widget';
// Disable the submit button until the upload sucesfully completed.
$form['#attached']['library'][] = 'dropzonejs_eb_widget/common';
$original_form['#attributes']['class'][] = 'dropzonejs-disable-submit';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment