diff options
author | Fatih Acet <acetfatih@gmail.com> | 2017-11-27 23:35:18 +0300 |
---|---|---|
committer | Tiago <tiagonbotelho@hotmail.com> | 2017-11-28 15:51:58 +0300 |
commit | 49845dd0685523b8a292dc854b013c525f5c0380 (patch) | |
tree | 9089057847782f722509eba9970e54b7591831aa /app | |
parent | 9a65e9b2605c8d9c878ffa844a7c7b6331f0df19 (diff) |
Merge branch 'backport-epic-fullscreen' into 'master'
Backport epic fullscreen
See merge request gitlab-org/gitlab-ce!15437
(cherry picked from commit 04ceeac1f6c56f1c1f3faa9da6e8bc563b6c1393)
880c9a2c Backport fix epic fullscreen
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/dropzone_input.js | 5 | ||||
-rw-r--r-- | app/assets/javascripts/zen_mode.js | 8 |
2 files changed, 10 insertions, 3 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..06a86f3b94a 100644 --- a/app/assets/javascripts/zen_mode.js +++ b/app/assets/javascripts/zen_mode.js @@ -71,7 +71,7 @@ export default class ZenMode { this.active_textarea = this.active_backdrop.find('textarea'); // Prevent a user-resized textarea from persisting to fullscreen this.active_textarea.removeAttr('style'); - return this.active_textarea.focus(); + this.active_textarea.focus(); } exit() { @@ -81,7 +81,11 @@ 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'); + if ($dropzone && !$dropzone.hasClass('js-invalid-dropzone')) { + Dropzone.forElement('.div-dropzone').enable(); + } } } |