bugfix
This commit is contained in:
parent
9d071ce1bf
commit
1c67e51755
@ -591,7 +591,7 @@ bricks.UiImage =class extends bricks.UiFile {
|
|||||||
if (params instanceof File){
|
if (params instanceof File){
|
||||||
params = [ params ];
|
params = [ params ];
|
||||||
}
|
}
|
||||||
if (params instanceof String){
|
if (typeof params == 'string'){
|
||||||
params = [ params ];
|
params = [ params ];
|
||||||
}
|
}
|
||||||
this.preview.clear_widgets();
|
this.preview.clear_widgets();
|
||||||
@ -601,10 +601,17 @@ bricks.UiImage =class extends bricks.UiFile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_show_image(file) {
|
_show_image(file) {
|
||||||
|
if (typeof file == 'string'){
|
||||||
|
var imgw = new bricks.Image({
|
||||||
|
url:file,
|
||||||
|
width:'100%'
|
||||||
|
});
|
||||||
|
this.preview.add_widget(imgw);
|
||||||
|
}
|
||||||
const reader = new FileReader();
|
const reader = new FileReader();
|
||||||
reader.onload = (e) => {
|
reader.onload = (e) => {
|
||||||
var imgw = new bricks.Image({
|
var imgw = new bricks.Image({
|
||||||
url:file,
|
url:e.target.result,
|
||||||
width:'100%'
|
width:'100%'
|
||||||
});
|
});
|
||||||
this.preview.add_widget(imgw);
|
this.preview.add_widget(imgw);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user