diff options
Diffstat (limited to 'assets/js/mumi.js')
-rw-r--r-- | assets/js/mumi.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/assets/js/mumi.js b/assets/js/mumi.js index 1ba77d0..df6e8ba 100644 --- a/assets/js/mumi.js +++ b/assets/js/mumi.js @@ -140,13 +140,29 @@ var mumi = (function () { tokenInput.setTokens(tokens); } }; + + var setupLineHandler = function () { + let lineClickHandler = (evt) => { + if ((evt.target.classList.contains("line")) && + (evt.x < evt.target.offsetLeft)) { + window.location.hash = evt.target.id; + return; + } + }; + var root = document.querySelector ("div.conversation"); + if (root === null) { return; } + root.addEventListener ("click", lineClickHandler); + }; + var init = function () { initTokenInput (); }; return({ 'init': init, + 'lines': setupLineHandler, }); })(); window.addEventListener ("load", mumi.init); +window.addEventListener ("DOMContentLoaded", mumi.lines); // @license-end |