Browse Source

add PluginHost.HOOK_HEADLINE_RENDERED

Andrew Dolgov 11 months ago
parent
commit
a0d332326c
2 changed files with 7 additions and 6 deletions
  1. 6 6
      js/Headlines.js
  2. 1 0
      js/PluginHost.js

+ 6 - 6
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);

+ 1 - 0
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')