1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-11 07:15:55 +00:00

note: use proper hook to set click handlers

This commit is contained in:
Andrew Dolgov
2022-02-05 11:49:33 +03:00
parent 4e35c44add
commit 6738f5c86b

View File

@@ -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;
});
});
});