mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-10-12 13:45:02 +08:00
fix: Do not reset loading animation (#1056)
This commit is contained in:
parent
06650e916a
commit
25227944b5
@ -93,6 +93,12 @@ function processInfo() {
|
||||
}
|
||||
}
|
||||
|
||||
function extractContent(s) {
|
||||
var span = document.createElement('span');
|
||||
span.innerHTML = s;
|
||||
return span.textContent || span.innerText;
|
||||
};
|
||||
|
||||
function setInfo(msg, loading, error) {
|
||||
try {
|
||||
|
||||
@ -119,9 +125,17 @@ function setInfo(msg, loading, error) {
|
||||
spin.style.visibility = 'hidden';
|
||||
}
|
||||
|
||||
var p = "<p class=\"loading\">";
|
||||
loading = !!loading;
|
||||
if (loading) {
|
||||
msg = "<p class=\"loading\">" + msg + "</p>";
|
||||
msg = p + msg + "</p>";
|
||||
}
|
||||
|
||||
if (msg.includes(p)) {
|
||||
if (el.innerHTML.includes(p)) {
|
||||
el.getElementsByClassName('loading')[0].textContent = extractContent(msg);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
el.innerHTML = msg;
|
||||
|
Loading…
x
Reference in New Issue
Block a user