nur namen vom file anzeigen

This commit is contained in:
Daniel Egger 2018-10-02 16:20:06 +02:00
parent c436f694e6
commit 329c068d80
3 changed files with 17 additions and 5 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="document-block"> <div class="document-block">
<document-icon class="document-block__icon"></document-icon> <document-icon class="document-block__icon"></document-icon>
<a :href="value.url" class="document-block__link" target="_blank">{{value.url}}</a> <a :href="value.url" class="document-block__link" target="_blank">{{urlName}}</a>
</div> </div>
</template> </template>
@ -13,6 +13,16 @@
components: { components: {
DocumentIcon DocumentIcon
},
computed: {
urlName: function() {
if (this.value && this.value.url) {
const parts = this.value.url.split('/');
return parts[parts.length - 1]
}
return null;
}
} }
} }
</script> </script>

View File

@ -21,13 +21,16 @@
// HACK to change the text of the Uploadcare dynamically we need to change the text here directly // HACK to change the text of the Uploadcare dynamically we need to change the text here directly
setTimeout(() => { setTimeout(() => {
const formElem = this.$refs['documentform']; const formElem = this.$refs['documentform'];
formElem.getElementsByClassName('uploadcare--text_size_extra-large')[1].innerText = 'Ziehen Sie ein Dokument hier hinein'; if (formElem.getElementsByClassName('uploadcare--text_size_extra-large').length > 1) {
formElem.getElementsByClassName('uploadcare--tab__action-button')[0].innerText = 'Wählen Sie ein lokales Dokument'; formElem.getElementsByClassName('uploadcare--text_size_extra-large')[1].innerText = 'Ziehen Sie ein Dokument hier hinein';
formElem.getElementsByClassName('uploadcare--tab__action-button')[0].innerText = 'Wählen Sie ein lokales Dokument';
}
}, 0); }, 0);
uploadcarePanel.done(panelResult => { uploadcarePanel.done(panelResult => {
panelResult.done(fileInfo => { panelResult.done(fileInfo => {
this.$emit('link-change-url', fileInfo.cdnUrl, this.index) let urlWithFilename = fileInfo.cdnUrl + fileInfo.name;
this.$emit('link-change-url', urlWithFilename, this.index)
}); });
panelResult.progress(p => { panelResult.progress(p => {

View File

@ -20,7 +20,6 @@
uploadcarePanel.done(panelResult => { uploadcarePanel.done(panelResult => {
panelResult.done(fileInfo => { panelResult.done(fileInfo => {
console.log(fileInfo);
this.$emit('link-change-url', fileInfo.cdnUrl, this.index) this.$emit('link-change-url', fileInfo.cdnUrl, this.index)
}); });