Duplicate object tag when updating the content of Document widget
Some browser does not refresh properly the content when updating the data attribute. Closes #12808
This commit is contained in:
@@ -4538,12 +4538,16 @@ function eval_pyson(value){
|
||||
});
|
||||
url = window.URL.createObjectURL(blob);
|
||||
}
|
||||
// duplicate object to force refresh on buggy browsers
|
||||
const object = this.object.clone();
|
||||
// set onload before data to be always called
|
||||
this.object.get(0).onload = function() {
|
||||
object.get(0).onload = function() {
|
||||
this.onload = null;
|
||||
window.URL.revokeObjectURL(url);
|
||||
};
|
||||
this.object.attr('data', url);
|
||||
object.attr('data', url);
|
||||
this.object.replaceWith(object);
|
||||
this.object = object;
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user