2019-04-27 22:42:02 +00:00
|
|
|
var spinner = {};
|
|
|
|
|
|
|
|
spinner.Spinner =
|
|
|
|
function Spinner(element)
|
|
|
|
{
|
|
|
|
this.show = function(delay)
|
|
|
|
{
|
|
|
|
clearTimeout(this.delayed_showing_timeout);
|
|
|
|
this.delayed_showing_timeout = null;
|
|
|
|
|
2019-06-15 21:24:50 +00:00
|
|
|
if (delay)
|
2019-04-27 22:42:02 +00:00
|
|
|
{
|
2019-06-15 21:30:23 +00:00
|
|
|
this.delayed_showing_timeout = setTimeout(function(thisthis){thisthis.show()}, delay, this);
|
2019-04-27 22:42:02 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-06-15 21:24:50 +00:00
|
|
|
this.element.classList.remove("hidden");
|
2019-04-27 22:42:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this.hide = function()
|
|
|
|
{
|
|
|
|
clearTimeout(this.delayed_showing_timeout);
|
|
|
|
this.delayed_showing_timeout = null;
|
|
|
|
|
|
|
|
this.element.classList.add("hidden");
|
|
|
|
}
|
|
|
|
|
|
|
|
this.delayed_showing_timeout = null;
|
|
|
|
this.element = element;
|
|
|
|
}
|