From 435da6f11d41896c16ee7aedb0c41c33eb259e89 Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Mon, 7 Jan 2019 01:15:15 +0100 Subject: Tweak the oplog-hover-thing The timeout makes things about 1000x more complicated, but adds a really nice effect too. --- web/js/nms-oplog.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/web/js/nms-oplog.js b/web/js/nms-oplog.js index b9bf55a..c49a980 100644 --- a/web/js/nms-oplog.js +++ b/web/js/nms-oplog.js @@ -220,17 +220,22 @@ class nmsOplogEntry extends nmsBox { setTimeout(function(e){e.clicked = false;},3000,this.nmsBox) } col2.html.onmouseover = function(e) { + this.nmsBox.over = true; + if (this.nmsBox.timer) { + clearTimeout(this.nmsBox.timer) + } this.nmsBox.searchbox.value = this.nmsBox.entry.systems; + this.nmsBox.searchbox.hoverSource = this.nmsBox; this.nmsBox.searchbox.oninput() } col2.html.onmouseleave = function(e) { + this.nmsBox.over = false; if (this.nmsBox.clicked) { return; } if (this.nmsBox.timer) { clearTimeout(this.nmsBox.timer) } this.nmsBox.timer = setTimeout(function(e){ - if (e.entry.systems == e.searchbox.value) { - console.log(e) + if (e.over == false && e.entry.systems == e.searchbox.value && e.searchbox.hoverSource == e) { e.searchbox.value = ""; e.searchbox.oninput() } -- cgit v1.2.3