Merge filepicker and share iframes

This commit is contained in:
yflory
2020-04-07 14:27:44 +02:00
parent 4672bf794b
commit 894a355f0a
18 changed files with 213 additions and 490 deletions

View File

@@ -941,8 +941,16 @@ define([
if (ifr) { ifr.remove(); }
};
common.initFilePicker({
onSelect: function (data) {
APP.AddImage = function(cb1, cb2) {
APP.AddImageSuccessCallback = cb1;
APP.AddImageErrorCallback = cb2;
common.openFilePicker({
types: ['file'],
where: ['root'],
filter: {
fileType: ['image/']
}
}, function (data) {
if (data.type !== 'file') {
debug("Unexpected data type picked " + data.type);
return;
@@ -963,19 +971,6 @@ define([
});
});
});
}
});
APP.AddImage = function(cb1, cb2) {
APP.AddImageSuccessCallback = cb1;
APP.AddImageErrorCallback = cb2;
common.openFilePicker({
types: ['file'],
where: ['root'],
filter: {
fileType: ['image/']
}
});
};