diff options
author | Denys Mishunov <dmishunov@gitlab.com> | 2019-04-17 23:51:17 +0300 |
---|---|---|
committer | Denys Mishunov <dmishunov@gitlab.com> | 2019-04-18 01:16:46 +0300 |
commit | 166c3ea296c4029e4536c193e5169fa613003186 (patch) | |
tree | 6a8b89eece6f0b6b4585bb3cb797c64d0e97137d /app/assets/javascripts/ide/components | |
parent | c8c8dd118a27b682c8c7a58d9bbea64c2c1ef445 (diff) |
Stores 'binary' and 'rawPath' attr after upload
- When uploading a file, we need to flag binary files correspondingly
so that it gets propagated all the way to RepoEditor as it decides on
whether to show editor for this or that file or not (shouldHideEditor())
- rawPath needs to be propagate all the way to ContentViewer as well so
that uploaded images could be rendered as a base64 image right away
instead of raw base64 string
Diffstat (limited to 'app/assets/javascripts/ide/components')
-rw-r--r-- | app/assets/javascripts/ide/components/new_dropdown/upload.vue | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/assets/javascripts/ide/components/new_dropdown/upload.vue b/app/assets/javascripts/ide/components/new_dropdown/upload.vue index ec759043efc..188518dd419 100644 --- a/app/assets/javascripts/ide/components/new_dropdown/upload.vue +++ b/app/assets/javascripts/ide/components/new_dropdown/upload.vue @@ -57,6 +57,8 @@ export default { type: 'blob', content: result, base64: !isText, + binary: !isText, + rawPath: !isText ? target.result : '', }); }, readFile(file) { |