Add spinner when setting automark.

This commit is contained in:
voussoir 2020-06-26 20:59:55 -07:00
parent 8d28484240
commit 27219d74c4

View file

@ -187,6 +187,7 @@ https://stackoverflow.com/a/35153397
<option value="downloaded" {{"selected" if channel.automark == "downloaded" else ""}} >downloaded</option> <option value="downloaded" {{"selected" if channel.automark == "downloaded" else ""}} >downloaded</option>
<option value="ignored" {{"selected" if channel.automark == "ignored" else ""}} >ignored</option> <option value="ignored" {{"selected" if channel.automark == "ignored" else ""}} >ignored</option>
</select> </select>
<span id="set_automark_spinner" class="hidden">Working...</span>
</span> </span>
{% endif %} {% endif %}
@ -502,9 +503,20 @@ function receive_action_response(response)
} }
} }
var set_automark_spinner = document.getElementById("set_automark_spinner");
set_automark_spinner = new spinner.Spinner(set_automark_spinner);
function set_automark_hook(event) function set_automark_hook(event)
{ {
api.channels.set_automark(CHANNEL_ID, event.target.value);
set_automark_spinner.show();
api.channels.set_automark(CHANNEL_ID, event.target.value, set_automark_callback);
}
function set_automark_callback(response)
{
if (response["meta"]["status"] == 200)
{
set_automark_spinner.hide();
}
} }
</script> </script>
</html> </html>