Commit df02630b authored by Julian Lam's avatar Julian Lam
Browse files

fix: filter:taskbar.push to use hooks module

parent 67138793
......@@ -2,7 +2,7 @@
"name": "nodebb-theme-persona",
"version": "11.1.3",
"nbbpm": {
"compatibility": "^1.17.0"
"compatibility": "^1.18.0"
},
"description": "Persona theme for NodeBB",
"main": "library.js",
......
......@@ -95,24 +95,26 @@ $(document).ready(function () {
}
function setupTaskbar() {
$(window).on('filter:taskbar.push', function (ev, data) {
data.options.className = 'taskbar-' + data.module;
if (data.module === 'composer') {
data.options.icon = 'fa-commenting-o';
} else if (data.module === 'chat') {
if (data.element.length && !data.element.hasClass('active')) {
increaseChatCount(data.element);
require(['hooks'], (hooks) => {
hooks.on('filter:taskbar.push', (data) => {
data.options.className = 'taskbar-' + data.module;
if (data.module === 'composer') {
data.options.icon = 'fa-commenting-o';
} else if (data.module === 'chat') {
if (data.element.length && !data.element.hasClass('active')) {
increaseChatCount(data.element);
}
}
}
});
$(window).on('action:taskbar.pushed', function (ev, data) {
if (data.module === 'chat') {
createChatIcon(data);
var elData = data.element.data();
if (elData && elData.options && !elData.options.isSelf) {
increaseChatCount(data.element);
});
hooks.on('action:taskbar.pushed', (data) => {
if (data.module === 'chat') {
createChatIcon(data);
var elData = data.element.data();
if (elData && elData.options && !elData.options.isSelf) {
increaseChatCount(data.element);
}
}
}
});
});
socket.on('event:chats.markedAsRead', function (data) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment