js: fixup bug in note hiding.

Fixup regression in e000bdb86.
This commit is contained in:
evazion
2019-08-18 03:50:43 -05:00
parent 6019a9fdc4
commit d7d4a63e69

View File

@@ -1,6 +1,8 @@
import Utility from './utility'
let Note = {
HIDE_DELAY: 250,
Box: {
create: function(id) {
var $inner_border = $('<div/>');
@@ -264,7 +266,7 @@ let Note = {
hide: function(id) {
var $note_body = Note.Body.find(id);
Note.timeouts.push($.timeout(250).done(function() {$note_body.hide();}));
Note.timeouts.push(setTimeout(() => $note_body.hide(), Note.HIDE_DELAY));
},
hide_all: function() {
@@ -762,10 +764,7 @@ let Note = {
},
clear_timeouts: function() {
$.each(Note.timeouts, function(i, v) {
v.clear();
});
Note.timeouts.forEach(clearTimeout);
Note.timeouts = [];
},