diff --git a/lib/client/storage/_filepicker.js b/lib/client/storage/_filepicker.js index 8c9387ed..05c255d3 100644 --- a/lib/client/storage/_filepicker.js +++ b/lib/client/storage/_filepicker.js @@ -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); }); }); }