js: add PluginHost.HOOK_COUNTERS_RECEIVED

This commit is contained in:
Andrew Dolgov 2019-05-06 09:49:04 +03:00
parent 4b74491b8b
commit 2411cc8d1c
2 changed files with 3 additions and 0 deletions

View File

@ -44,6 +44,8 @@ define(["dojo/_base/declare"], function (declare) {
this._counters_prev = []; this._counters_prev = [];
}, },
parseCounters: function (elems) { parseCounters: function (elems) {
PluginHost.run(PluginHost.HOOK_COUNTERS_RECEIVED, elems);
for (let l = 0; l < elems.length; l++) { for (let l = 0; l < elems.length; l++) {
if (Feeds._counters_prev[l] && this.counterEquals(elems[l], this._counters_prev[l])) { if (Feeds._counters_prev[l] && this.counterEquals(elems[l], this._counters_prev[l])) {

View File

@ -13,6 +13,7 @@ PluginHost = {
HOOK_FLOATING_TITLE: 10, HOOK_FLOATING_TITLE: 10,
HOOK_INIT_COMPLETE: 11, HOOK_INIT_COMPLETE: 11,
HOOK_HEADLINE_RENDERED: 12, HOOK_HEADLINE_RENDERED: 12,
HOOK_COUNTERS_RECEIVED: 13,
hooks: [], hooks: [],
register: function (name, callback) { register: function (name, callback) {
if (typeof(this.hooks[name]) == 'undefined') if (typeof(this.hooks[name]) == 'undefined')