refactor(dom) init: LoadingImage

This commit is contained in:
coderaiser 2016-12-05 16:41:56 +02:00
parent f05755d55c
commit f63772668e

View file

@ -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;