aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Lyngstol <kly@kly.no>2019-01-07 01:03:44 +0100
committerKristian Lyngstol <kly@kly.no>2019-01-07 01:03:44 +0100
commit605c347a7a9919bf741d24d80c27faded3971b85 (patch)
tree29abb640d4a5c6a5c22bccd68108f435f1c67ef3
parentbba0ba1368e9b0918f1200149ffbbde6c400e302 (diff)
Auto-hilight systems on oplog-hover
-rw-r--r--web/js/nms-oplog.js29
1 files changed, 24 insertions, 5 deletions
diff --git a/web/js/nms-oplog.js b/web/js/nms-oplog.js
index 0580d40..b9bf55a 100644
--- a/web/js/nms-oplog.js
+++ b/web/js/nms-oplog.js
@@ -212,11 +212,30 @@ class nmsOplogEntry extends nmsBox {
}
col2.searchbox = document.getElementById("searchbox")
col2.entry = this;
- col2.html.onclick = function(e) {
- var x = document.getElementById("searchbox");
- var v = e.path[0].hiddenthing;
- this.nmsBox.searchbox.value = this.nmsBox.entry.systems;
- this.nmsBox.searchbox.oninput()
+ if (this.systems != undefined && this.systems != null && this.systems != "") {
+ col2.html.onclick = function(e) {
+ this.nmsBox.searchbox.value = this.nmsBox.entry.systems;
+ this.nmsBox.searchbox.oninput()
+ this.nmsBox.clicked = true;
+ setTimeout(function(e){e.clicked = false;},3000,this.nmsBox)
+ }
+ col2.html.onmouseover = function(e) {
+ this.nmsBox.searchbox.value = this.nmsBox.entry.systems;
+ this.nmsBox.searchbox.oninput()
+ }
+ col2.html.onmouseleave = function(e) {
+ 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)
+ e.searchbox.value = "";
+ e.searchbox.oninput()
+ }
+ },2000,this.nmsBox)
+ }
}
this.add(td1)
td2.add(col2)