diff options
author | Andrew Dolgov <[email protected]> | 2022-02-05 11:49:33 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2022-02-05 11:49:33 +0300 |
commit | 6738f5c86beb841e30548dafaed45fc2850f619d (patch) | |
tree | ccb52e27d00b3bbceb98e56970c34a6cbbf07d5d | |
parent | 4e35c44add23791d6dc886bf71b325948e55b61a (diff) |
note: use proper hook to set click handlers
-rw-r--r-- | plugins/note/note.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/note/note.js b/plugins/note/note.js index ea173bba6..00deb0543 100644 --- a/plugins/note/note.js +++ b/plugins/note/note.js @@ -5,7 +5,7 @@ require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) { Plugins.Note = { set_click_handler: function() { - document.querySelectorAll(".article-note[data-note-for]").forEach((note) => { + App.findAll(".article-note[data-note-for]").forEach((note) => { note.onclick = function() { Plugins.Note.edit(this.getAttribute('data-note-for')); } @@ -50,9 +50,8 @@ require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) { } }; - PluginHost.register(PluginHost.HOOK_HEADLINE_RENDERED, function() { + PluginHost.register(PluginHost.HOOK_HEADLINES_RENDERED, () => { Plugins.Note.set_click_handler(); - return true; }); }); }); |