Untitled

 avatar
unknown
plain_text
a year ago
1.2 kB
6
Indexable
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);
                    });
            }
        });

    }
Editor is loading...
Leave a Comment