mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(dropbox) load
This commit is contained in:
parent
1892f12239
commit
abc120974e
1 changed files with 14 additions and 8 deletions
|
|
@ -24,20 +24,26 @@ var CloudCmd, Util, DOM, CloudFunc, Dropbox, cb, Client;
|
|||
* function loads dropbox.js
|
||||
*/
|
||||
function load(callback) {
|
||||
console.time('dropbox load');
|
||||
Util.time('dropbox load');
|
||||
|
||||
var lSrc = '//cdnjs.cloudflare.com/ajax/libs/dropbox.js/0.10.2/dropbox.min.js',
|
||||
lLocal = '/node_modules/dropbox/lib/dropbox.js',
|
||||
lOnload = function(){
|
||||
console.timeEnd('dropbox load');
|
||||
var src = '//cdnjs.cloudflare.com/ajax/libs/dropbox.js/0.10.2/dropbox.min.js',
|
||||
local = '/node_modules/dropbox/lib/dropbox.js',
|
||||
|
||||
onError = function onError() {
|
||||
Util.time('dropbox load');
|
||||
DOM.load.js(local, onLoad);
|
||||
},
|
||||
|
||||
onLoad = function(){
|
||||
Util.timeEnd('dropbox load');
|
||||
DOM.Images.hide();
|
||||
|
||||
Util.exec(callback);
|
||||
};
|
||||
|
||||
DOM.load.js(lSrc, {
|
||||
onload : lOnload,
|
||||
error : DOM.retJSLoad(lLocal, lOnload)
|
||||
DOM.load.js(src, {
|
||||
onload : onload,
|
||||
error : onError
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue