Fix bug in param timestamp tooltip

This commit is contained in:
Zaid Abdulla committed 2018-12-27 01:21:18 -08:00
1 parent bb416d25b9
commit bae54300a7
1 file changed
+9 -4
+9 -4
View File
@@ -69,19 +69,24 @@ const component = {
); );
} }
return m( const el = m(
"span.parameter-value", "span.parameter-value",
{ {
onmouseover: e => { onmouseover: e => {
e.redraw = false; e.redraw = false;
const now = Date.now(); // Don't update any child element
const localeString = new Date(timestamp).toLocaleString(); if (e.target === el.dom) {
e.target.title = `${localeString} (${timeAgo(now - timestamp)})`; const now = Date.now();
const localeString = new Date(timestamp).toLocaleString();
e.target.title = `${localeString} (${timeAgo(now - timestamp)})`;
}
} }
}, },
value, value,
edit edit
); );
return el;
} }
}; };