summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2017-11-16 16:11:12 -0600
committerClement Ho <ClemMakesApps@gmail.com>2017-11-16 16:11:12 -0600
commita7787de5d217883668f5f44e3cecb909b7ffe935 (patch)
tree89a892f678ade2d710b1436ce6f65de88dff283a
parentd41e66cb632cf4a51428c87a07cbdd182e3e0697 (diff)
downloadgitlab-ce-backport-epic-fullscreen.tar.gz
Backport epic fullscreenbackport-epic-fullscreen
-rw-r--r--app/assets/javascripts/dropzone_input.js5
-rw-r--r--app/assets/javascripts/zen_mode.js7
2 files changed, 10 insertions, 2 deletions
diff --git a/app/assets/javascripts/dropzone_input.js b/app/assets/javascripts/dropzone_input.js
index b7747ee3f83..c84be42649a 100644
--- a/app/assets/javascripts/dropzone_input.js
+++ b/app/assets/javascripts/dropzone_input.js
@@ -36,7 +36,10 @@ export default function dropzoneInput(form) {
$formDropzone.append(divHover);
$formDropzone.find('.div-dropzone-hover').append(iconPaperclip);
- if (!uploadsPath) return;
+ if (!uploadsPath) {
+ $formDropzone.addClass('js-invalid-dropzone');
+ return;
+ }
const dropzone = $formDropzone.dropzone({
url: uploadsPath,
diff --git a/app/assets/javascripts/zen_mode.js b/app/assets/javascripts/zen_mode.js
index cba7b9227cd..3217744860a 100644
--- a/app/assets/javascripts/zen_mode.js
+++ b/app/assets/javascripts/zen_mode.js
@@ -81,7 +81,12 @@ export default class ZenMode {
this.scrollTo(this.active_textarea);
this.active_textarea = null;
this.active_backdrop = null;
- return Dropzone.forElement('.div-dropzone').enable();
+
+ const $dropzone = $('.div-dropzone');
+ const hasDropzone = $dropzone && !$dropzone.hasClass('js-invalid-dropzone');
+ if (hasDropzone) {
+ Dropzone.forElement('.div-dropzone').enable();
+ }
}
}