From 3040609816342f5ce35f672600b838d52b009b12 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Thu, 22 Jan 2015 21:28:35 +0000 Subject: [PATCH] Doubleclick on a table entry to follow that aircraft. --- public_html/script.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public_html/script.js b/public_html/script.js index 08580b2..8625f74 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -78,7 +78,8 @@ function processReceiverUpdate(data) { plane.tr.cells[0].textContent = hex; } - plane.tr.addEventListener('click', selectPlaneByHex.bind(undefined,hex)); + plane.tr.addEventListener('click', selectPlaneByHex.bind(undefined,hex,false)); + plane.tr.addEventListener('dblclick', selectPlaneByHex.bind(undefined,hex,true)); Planes[hex] = plane; PlanesOrdered.push(plane); @@ -819,7 +820,7 @@ function sortBy(id,sc,se) { resortTable(); } -function selectPlaneByHex(hex) { +function selectPlaneByHex(hex,autofollow) { //console.log("select: " + hex); // If SelectedPlane has something in it, clear out the selected if (SelectedPlane != null) { @@ -845,7 +846,7 @@ function selectPlaneByHex(hex) { SelectedPlane = null; } - FollowSelected = false; + FollowSelected = (autofollow ? true : false); refreshSelected(); }