mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
chore(dom) showLoad
This commit is contained in:
parent
5ba53f850f
commit
b4f39d8797
1 changed files with 16 additions and 17 deletions
|
|
@ -44,36 +44,35 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
* Function shows loading spinner
|
||||
* pPosition = {top: true};
|
||||
*/
|
||||
this.showLoad = function(pPosition) {
|
||||
var lCurrent,
|
||||
lLoadingImage = lImages.loading(),
|
||||
lErrorImage = lImages.error();
|
||||
this.showLoad = function(position) {
|
||||
var top = position && position.top,
|
||||
current,
|
||||
loadingImage = lImages.loading(),
|
||||
errorImage = lImages.error(),
|
||||
parent = loadingImage.parentElement;
|
||||
|
||||
DOM.hide(lErrorImage);
|
||||
DOM.hide(errorImage);
|
||||
|
||||
if (pPosition && pPosition.top)
|
||||
lCurrent = DOM.getRefreshButton().parentElement;
|
||||
if (top)
|
||||
current = DOM.getRefreshButton().parentElement;
|
||||
else {
|
||||
lCurrent = DOM.getCurrentFile();
|
||||
lCurrent = DOM.getByClass('name', lCurrent);
|
||||
current = DOM.getCurrentFile();
|
||||
current = DOM.getByClass('name', current);
|
||||
}
|
||||
|
||||
/* show loading icon if it not showed */
|
||||
if (!parent || (parent && parent !== current))
|
||||
current.appendChild(loadingImage);
|
||||
|
||||
var lParent = lLoadingImage.parentElement;
|
||||
if (!lParent || (lParent && lParent !== lCurrent))
|
||||
lCurrent.appendChild(lLoadingImage);
|
||||
DOM.show(loadingImage);
|
||||
|
||||
DOM.show(lLoadingImage); /* показываем загрузку*/
|
||||
|
||||
return lLoadingImage;
|
||||
return loadingImage;
|
||||
};
|
||||
|
||||
/**
|
||||
* hide load image
|
||||
*/
|
||||
this.hideLoad = function() {
|
||||
DOM.hide( lImages.loading());
|
||||
DOM.hide(lImages.loading());
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue