Explorar o código

Simpler comparison

Co-authored-by: missionfloyd <missionfloyd@users.noreply.github.com>
catboxanon hai 1 ano
pai
achega
5ab5405b6f
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      javascript/edit-attention.js

+ 2 - 2
javascript/edit-attention.js

@@ -65,10 +65,10 @@ function keyupEditAttention(event) {
         }
         }
 
 
         // deselect surrounding whitespace
         // deselect surrounding whitespace
-        while (target.value.slice(selectionStart, selectionStart + 1) == " " && selectionStart < selectionEnd) {
+        while (text[selectionStart] == " " && selectionStart < selectionEnd) {
             selectionStart++;
             selectionStart++;
         }
         }
-        while (target.value.slice(selectionEnd - 1, selectionEnd) == " " && selectionEnd > selectionStart) {
+        while (text[selectionEnd - 1] == " " && selectionEnd > selectionStart) {
             selectionEnd--;
             selectionEnd--;
         }
         }