mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
refactor(dom) init: LoadingImage
This commit is contained in:
parent
f05755d55c
commit
f63772668e
1 changed files with 8 additions and 15 deletions
|
|
@ -16,34 +16,27 @@ var CloudCmd, Util, DOM, CloudFunc;
|
|||
HIDDEN = 'hidden',
|
||||
ERROR = 'error';
|
||||
|
||||
function getLoadingType() {
|
||||
return DOM.isSVG() ? '-svg' : '-gif';
|
||||
}
|
||||
|
||||
function init() {
|
||||
var is;
|
||||
if (LoadingImage)
|
||||
return;
|
||||
|
||||
if (!LoadingImage) {
|
||||
LoadingImage = LOADING;
|
||||
is = DOM.isSVG();
|
||||
|
||||
if (is)
|
||||
LoadingImage += '-svg';
|
||||
else
|
||||
LoadingImage += '-gif';
|
||||
}
|
||||
LoadingImage = LOADING + getLoadingType();
|
||||
}
|
||||
|
||||
function getElement() {
|
||||
var element;
|
||||
|
||||
init();
|
||||
|
||||
element = DOM.load({
|
||||
return DOM.load({
|
||||
name : 'span',
|
||||
id : 'js-status-image',
|
||||
className : 'icon',
|
||||
attribute : 'data-progress',
|
||||
notAppend : true
|
||||
});
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
this.get = getElement;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue