Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2019-02-11 05:40:30 +0300
committerDouwe Maan <douwe@selenight.nl>2019-05-05 23:20:54 +0300
commit26526794b20d9b0c186519ced796961ceb100560 (patch)
tree15454216912c853cf69342586212305c82c4d2b0 /app
parentf933eca7efdb2a0200df644c118e9ada96e4f2a5 (diff)
Move dropzone setup to MarkdownField
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/vue_shared/components/markdown/field.vue10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/assets/javascripts/vue_shared/components/markdown/field.vue b/app/assets/javascripts/vue_shared/components/markdown/field.vue
index c50f04e69dd..31a658206c1 100644
--- a/app/assets/javascripts/vue_shared/components/markdown/field.vue
+++ b/app/assets/javascripts/vue_shared/components/markdown/field.vue
@@ -13,6 +13,7 @@ import icon from '../icon.vue';
import Suggestions from '~/vue_shared/components/markdown/suggestions.vue';
import { updateText } from '~/lib/utils/text_markdown';
import GfmAutoComplete, * as GFMConfig from '~/gfm_auto_complete';
+import dropzoneInput from '~/dropzone_input';
export default {
components: {
@@ -117,6 +118,7 @@ export default {
isFocused: false,
mode: 'markdown',
autocomplete: null,
+ dropzone: null,
currentValue: this.value,
renderedLoading: false,
renderedValue: null,
@@ -237,6 +239,8 @@ export default {
this.autocomplete = this.setupAutocomplete();
}
+ this.dropzone = dropzoneInput($(this.$refs.glForm));
+
Autosize(this.$refs.textarea);
this.autosizeTextarea();
},
@@ -250,6 +254,10 @@ export default {
this.autocomplete.destroy();
}
+ if (this.dropzone) {
+ this.dropzone.disable();
+ }
+
Autosize.destroy(this.$refs.textarea);
},
methods: {
@@ -404,7 +412,7 @@ export default {
@toolbar-button-clicked="toolbarButtonClicked"
/>
<div v-show="modeIsMarkdown" class="md-write-holder">
- <div :class="{ 'zen-backdrop': modeIsMarkdown }">
+ <div class="div-dropzone-wrapper" :class="{ 'zen-backdrop': modeIsMarkdown }">
<textarea
:id="textareaId"
ref="textarea"