Untitled

mail@pastecode.io avatar
unknown
plain_text
25 days ago
1.2 kB
2
Indexable
Never
uploadModalTrigger(e) {
        e.preventDefault();

        UploadImageModal.fire({
            title: 'Select image',
            input: 'file',
            showLoaderOnConfirm: true,
            showCancelButton: true,
            customClass: {
                container: 'file-upload-modal'
            },
            inputAttributes: {
                'accept': 'image/*',
                'multiple': 'multiple',
            },
            preConfirm: (inputValue) => {
                if (inputValue) {
                    return this.addDamageImage(inputValue)
                        .then(() => {
                            return this.refreshImages();
                        })
                        .catch(err => {
                        console.log(err);
                    });
                }
            }
        }).then(resp => {
            if (resp.value) {
                this.addDamageImage(resp.value)
                    .then(() => {
                        this.refreshImages();
                    })
                    .catch(err => {
                            console.log(err);
                    });
            }
        });

    }
Leave a Comment