From a0d332326c8ff511b8dd05008a4c368fef623434 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 8 Dec 2018 20:08:57 +0300 Subject: [PATCH] add PluginHost.HOOK_HEADLINE_RENDERED --- js/Headlines.js | 12 ++++++------ js/PluginHost.js | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/js/Headlines.js b/js/Headlines.js index 0c8ce5abf..9a9576573 100755 --- a/js/Headlines.js +++ b/js/Headlines.js @@ -365,13 +365,13 @@ define(["dojo/_base/declare"], function (declare) { `; } - if (row != null) { - const tmp = document.createElement("div"); - tmp.innerHTML = row; - dojo.parser.parse(tmp); + const tmp = document.createElement("div"); + tmp.innerHTML = row; + dojo.parser.parse(tmp); - $("headlines-frame").appendChild(tmp.firstChild); - } + PluginHost.run(PluginHost.HOOK_HEADLINE_RENDERED, tmp.firstChild); + + $("headlines-frame").appendChild(tmp.firstChild); }, onLoaded: function (transport, offset) { const reply = App.handleRpcJson(transport); diff --git a/js/PluginHost.js b/js/PluginHost.js index c188531f8..7c2a975e0 100644 --- a/js/PluginHost.js +++ b/js/PluginHost.js @@ -12,6 +12,7 @@ PluginHost = { HOOK_RUNTIME_INFO_LOADED: 9, HOOK_FLOATING_TITLE: 10, HOOK_INIT_COMPLETE: 11, + HOOK_HEADLINE_RENDERED: 12, hooks: [], register: function (name, callback) { if (typeof(this.hooks[name]) == 'undefined')