nodebb-plugin-poll 4.0.7 → 4.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/public/js/poll/creator.js +10 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodebb-plugin-poll",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.8",
|
|
4
4
|
"description": "NodeBB Poll Plugin",
|
|
5
5
|
"main": "library.js",
|
|
6
6
|
"scripts": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"cron": "^1.8.2"
|
|
27
27
|
},
|
|
28
28
|
"nbbpm": {
|
|
29
|
-
"compatibility": "^4.
|
|
29
|
+
"compatibility": "^4.12.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"eslint": "10.0.3",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
formatting.addButtonDispatch('poll', function (/* textarea */) {
|
|
14
14
|
onPollButtonClicked(composer);
|
|
15
15
|
});
|
|
16
|
-
|
|
17
|
-
updateComposerBadgeCount(
|
|
16
|
+
const uuid = postContainer.attr('data-uuid');
|
|
17
|
+
updateComposerBadgeCount(uuid, postData.polls ? postData.polls.length : 0);
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
}
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
postData.polls.push(newPoll);
|
|
70
70
|
}
|
|
71
71
|
openManageModal({ ...payload, modal });
|
|
72
|
-
|
|
73
|
-
updateComposerBadgeCount(
|
|
72
|
+
|
|
73
|
+
updateComposerBadgeCount(uuid, postData.polls.length);
|
|
74
74
|
});
|
|
75
75
|
return false;
|
|
76
76
|
},
|
|
@@ -100,8 +100,7 @@
|
|
|
100
100
|
if (poll) {
|
|
101
101
|
postData.polls = postData.polls.filter(poll => String(poll.pollId) !== clickedPollId);
|
|
102
102
|
openManageModal(payload);
|
|
103
|
-
|
|
104
|
-
updateComposerBadgeCount(postContainer, postData.polls.length);
|
|
103
|
+
updateComposerBadgeCount(uuid, postData.polls.length);
|
|
105
104
|
}
|
|
106
105
|
});
|
|
107
106
|
});
|
|
@@ -270,13 +269,11 @@
|
|
|
270
269
|
});
|
|
271
270
|
}
|
|
272
271
|
|
|
273
|
-
function updateComposerBadgeCount(
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
count
|
|
279
|
-
);
|
|
272
|
+
function updateComposerBadgeCount(uuid, count) {
|
|
273
|
+
$(window).trigger('action:composer.updateFormattingBtnBadgeCount', {
|
|
274
|
+
uuid: uuid,
|
|
275
|
+
formatName: 'poll',
|
|
276
|
+
count,
|
|
280
277
|
});
|
|
281
278
|
}
|
|
282
279
|
|