mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(dom) mv set font to listeners
This commit is contained in:
parent
026a8b53b3
commit
b973e2541a
2 changed files with 17 additions and 12 deletions
|
|
@ -1061,18 +1061,6 @@ var CloudCmd, Util, DOM, CloudFunc;
|
|||
Loader.jsload('/lib/client/jquery.js', {
|
||||
onload: pCallBack
|
||||
});
|
||||
|
||||
/* if could not load jquery from google server
|
||||
* maybe we offline, load font from local
|
||||
* directory */
|
||||
Loader.cssSet({
|
||||
id :'local-droids-font',
|
||||
element : document.head,
|
||||
inner : '@font-face {font-family: "Droid Sans Mono";' +
|
||||
'font-style: normal;font-weight: normal;' +
|
||||
'src: local("Droid Sans Mono"), local("DroidSansMono"),'+
|
||||
' url("/font/DroidSansMono.woff") format("woff");}'
|
||||
});
|
||||
},
|
||||
function(callback) {
|
||||
Loader.jquery({
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ var Util, DOM, CloudCmd;
|
|||
dragndrop();
|
||||
unload();
|
||||
pop();
|
||||
online();
|
||||
};
|
||||
|
||||
this.initKeysPanel = function() {
|
||||
|
|
@ -289,6 +290,22 @@ var Util, DOM, CloudCmd;
|
|||
});
|
||||
}
|
||||
|
||||
function online() {
|
||||
var cssSet = Util.retExec(DOM.cssSet, {
|
||||
id :'local-droids-font',
|
||||
element : document.head,
|
||||
inner : '@font-face {font-family: "Droid Sans Mono";' +
|
||||
'font-style: normal;font-weight: normal;' +
|
||||
'src: local("Droid Sans Mono"), local("DroidSansMono"),'+
|
||||
' url("/font/DroidSansMono.woff") format("woff");}'
|
||||
});
|
||||
|
||||
if (navigator.onLine)
|
||||
Events.addOneTime('offline', cssSet);
|
||||
else
|
||||
cssSet();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})(Util, DOM);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue