mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-25 08:54:10 +00:00
refactor(filepicker) load
This commit is contained in:
parent
181f86405c
commit
88564af56b
1 changed files with 9 additions and 9 deletions
|
|
@ -45,20 +45,20 @@ var CloudCmd, Util, DOM, filepicker;
|
|||
});
|
||||
};
|
||||
|
||||
function load(pCallBack) {
|
||||
function load(callback) {
|
||||
Util.time('filepicker load');
|
||||
var lHTTP = document.location.protocol;
|
||||
|
||||
DOM.jsload(lHTTP + '//api.filepicker.io/v1/filepicker.js', function() {
|
||||
CloudCmd.getModules(function(pModules) {
|
||||
var lStorage = Util.findObjByNameInArr(pModules, 'storage'),
|
||||
lFilePicker = Util.findObjByNameInArr(lStorage, 'FilePicker'),
|
||||
lKey = lFilePicker && lFilePicker.key;
|
||||
DOM.jsload('//api.filepicker.io/v1/filepicker.js', function() {
|
||||
CloudCmd.getModules(function(modules) {
|
||||
var storage = Util.findObjByNameInArr(modules, 'storage'),
|
||||
picker = Util.findObjByNameInArr(storage, 'FilePicker'),
|
||||
key = picker && picker.key;
|
||||
|
||||
filepicker.setKey(key);
|
||||
|
||||
filepicker.setKey(lKey);
|
||||
DOM.Images.hideLoad();
|
||||
Util.timeEnd('filepicker loaded');
|
||||
Util.exec(pCallBack);
|
||||
Util.exec(callback);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue