From 88564af56b710a4df38f5c55cf389f0c1b5758e8 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 10 Feb 2014 03:28:13 -0500 Subject: [PATCH] refactor(filepicker) load --- lib/client/storage/_filepicker.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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); }); }); }