Fix broken file widget's accept option caused by Resumable overriding it on initiation

This commit is contained in:
Hadi Nategh 2022-04-06 14:45:09 +02:00
parent 29dac6f76d
commit b303f16d61
2 changed files with 4 additions and 3 deletions

View File

@ -114,8 +114,6 @@ var et2_file = /** @class */ (function (_super) {
jQuery(span).removeClass('et2_file_spanActive');
}
});
if (this.options.accept)
this.input.attr('accept', this.options.accept);
var self = this;
// trigger native input upload file
if (!this.options.readonly)
@ -132,6 +130,8 @@ var et2_file = /** @class */ (function (_super) {
else {
// This may be a problem submitting via ajax
}
if (this.options.accept)
this.input.attr('accept', this.options.accept);
if (this.options.progress) {
var widget = this.getRoot().getWidgetById(this.options.progress);
if (widget) {

View File

@ -198,7 +198,6 @@ export class et2_file extends et2_inputWidget
jQuery(span).removeClass('et2_file_spanActive');
}
});
if (this.options.accept) this.input.attr('accept', this.options.accept);
let self = this;
// trigger native input upload file
if (!this.options.readonly) this.span.click(function(){self.input.click()});
@ -216,6 +215,8 @@ export class et2_file extends et2_inputWidget
{
// This may be a problem submitting via ajax
}
if (this.options.accept) this.input.attr('accept', this.options.accept);
if(this.options.progress)
{
let widget = this.getRoot().getWidgetById(this.options.progress);