From 35fc76c02ccaf8f62b5e2e23341009aaa8565929 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Thu, 1 Apr 2021 12:53:19 +0200 Subject: [PATCH] Fix auto jump on viewing the diff --- backend/templates/diff.html | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/backend/templates/diff.html b/backend/templates/diff.html index eb6a361f..bce1dd3e 100644 --- a/backend/templates/diff.html +++ b/backend/templates/diff.html @@ -8,7 +8,7 @@
+ Words @@ -19,9 +19,9 @@ @@ -90,6 +90,10 @@ function changed() { result.textContent = ''; result.appendChild(fragment); + + // Jump at start + inputs.current=0; + next_diff(); } window.onload = function() { @@ -112,6 +116,7 @@ window.onload = function() { onDiffTypeChange(document.querySelector('#settings [name="diff_type"]:checked')); changed(); + }; a.onpaste = a.onchange = @@ -139,8 +144,7 @@ for (var i = 0; i < radio.length; i++) { var inputs = document.getElementsByClassName('change'); inputs.current=0; -// Jump at start -next_diff(); + function next_diff() { @@ -161,6 +165,7 @@ function next_diff() { } +