mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
Fix image with same pathname not updated
&& add boolean in onechange
This commit is contained in:
parent
d85554b032
commit
011949e757
@ -29,6 +29,8 @@ class ImageController extends Controller {
|
||||
constructor(object, property) {
|
||||
super(object, property);
|
||||
|
||||
this.__onChangeFirstTime = true;
|
||||
|
||||
this.__fileReader = new FileReader();
|
||||
|
||||
const _this = this;
|
||||
@ -62,7 +64,8 @@ class ImageController extends Controller {
|
||||
_this.__imagePreview.src = _this.__image.src;
|
||||
|
||||
if (_this.__onChange) {
|
||||
_this.__onChange.call(_this, _this.__image);
|
||||
_this.__onChange.call(_this, _this.__image, _this.__onChangeFirstTime);
|
||||
_this.__onChangeFirstTime = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,6 +74,7 @@ class ImageController extends Controller {
|
||||
if (!file) {
|
||||
return;
|
||||
}
|
||||
_this.__input.value = '';
|
||||
_this.__fileReader.readAsDataURL(file);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user