aboutsummaryrefslogtreecommitdiff
path: root/resources/vue/mixins/courseware/wizard.js
blob: b3ea222d445a4075e2ffd1324d7c1cd7e8ebbb66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const wizardMixin = {
    methods: {
        checkUploadImageFile(file) {
            let uploadFileError = '';
            if (file.size > 2097152) {
                uploadFileError = this.$gettext('Diese Datei ist zu groß. Bitte wählen Sie eine Datei aus, die kleiner als 2MB ist.');
            }
            if (!file.type.includes('image')) {
                uploadFileError = this.$gettext('Diese Datei ist kein Bild. Bitte wählen Sie ein Bild aus.');
            }

            return uploadFileError;
        },
    }
};

export default wizardMixin;