Skip to content

Commit

Permalink
fixes #713
Browse files Browse the repository at this point in the history
  • Loading branch information
tgloeggl committed Jun 15, 2023
1 parent 042800c commit 0fcad33
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 25 deletions.
2 changes: 0 additions & 2 deletions vueapp/components/Videos/Actions/CaptionUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ import StudipDialog from '@studip/StudipDialog'
import StudipButton from '@studip/StudipButton'
import MessageBox from '@/components/MessageBox'
import ProgressBar from '@/components/ProgressBar'
import ConfirmDialog from '@/components/ConfirmDialog'
import UploadService from '@/common/upload.service'
export default {
Expand All @@ -108,7 +107,6 @@ export default {
MessageBox,
StudipButton,
ProgressBar,
ConfirmDialog
},
emits: ['done', 'cancel'],
Expand Down
41 changes: 18 additions & 23 deletions vueapp/components/Videos/VideoUpload.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
<template>
<div>
<ConfirmDialog v-if="showConfirmDialog"
:title="$gettext('Hochladen abbrechen')"
:message="$gettext('Sind sie sicher, dass sie das Hochladen abbrechen möchten?')"
@done="decline"
@cancel="showConfirmDialog = false"
/>
<StudipDialog v-else
<StudipDialog
:title="$gettext('Video hinzufügen')"
:confirmText="$gettext('Hochladen')"
:confirmClass="uploadButtonClasses"
:closeText="$gettext('Abbrechen')"
:closeClass="'cancel'"
height="600"
width="600"
@close="showConfirmDialog=true"
@close="confirmCancel"
@confirm="accept"
>
<template v-slot:dialogContent ref="upload-dialog">
Expand Down Expand Up @@ -202,7 +196,6 @@ import StudipButton from '@studip/StudipButton'
import MessageBox from '@/components/MessageBox'
import VideoFilePreview from '@/components/Videos/VideoFilePreview'
import ProgressBar from '@/components/ProgressBar'
import ConfirmDialog from '@/components/ConfirmDialog'
import UploadService from '@/common/upload.service'
import { format } from 'date-fns'
Expand All @@ -217,7 +210,6 @@ export default {
StudipButton,
VideoFilePreview,
ProgressBar,
ConfirmDialog
},
emits: ['done', 'cancel'],
Expand All @@ -241,7 +233,6 @@ export default {
'presentation/source': []
},
uploadProgress: null,
showConfirmDialog: false
}
},
Expand Down Expand Up @@ -284,6 +275,21 @@ export default {
},
methods: {
confirmCancel()
{
if (confirm('Sind sie sicher, dass sie das Hochladen abbrechen möchten?')) {
if (this.uploadProgress) {
this.uploadService.cancel();
}
this.uploadService = null;
this.uploadProgress = null;
this.$emit('cancel');
}
}
},
async accept() {
if (this.uploadProgress) {
return;
Expand Down Expand Up @@ -373,17 +379,6 @@ export default {
});
},
decline() {
if (this.uploadProgress) {
this.uploadService.cancel();
}
this.uploadService = null;
this.uploadProgress = null;
this.$emit('cancel');
},
chooseFiles(id) {
this.$refs[id].click();
},
Expand All @@ -392,7 +387,7 @@ export default {
let flavor = event.target.attributes['data-flavor'].value;
this.files[flavor] = event.target.files;
}
},
,
mounted() {
this.$store.dispatch('authenticateLti');
Expand Down

0 comments on commit 0fcad33

Please sign in to comment.