Improved magic and staleness indicator animations

This commit is contained in:
n1474335 2018-07-27 15:18:08 +00:00
parent 541e4ff8cd
commit 33b2fd8d69
7 changed files with 37 additions and 25 deletions

View file

@ -60,10 +60,11 @@ class InputWaiter {
* Sets the input in the input area.
*
* @param {string|File} input
* @param {boolean} [silent=false] - Suppress statechange event
*
* @fires Manager#statechange
*/
set(input) {
set(input, silent=false) {
const inputText = document.getElementById("input-text");
if (input instanceof File) {
this.setFile(input);
@ -72,7 +73,7 @@ class InputWaiter {
} else {
inputText.value = input;
this.closeFile();
window.dispatchEvent(this.manager.statechange);
if (!silent) window.dispatchEvent(this.manager.statechange);
const lines = input.length < (this.app.options.ioDisplayThreshold * 1024) ?
input.count("\n") + 1 : null;
this.setInputInfo(input.length, lines);