Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/mr_notes/init_count.js')
-rw-r--r--app/assets/javascripts/mr_notes/init_count.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/assets/javascripts/mr_notes/init_count.js b/app/assets/javascripts/mr_notes/init_count.js
new file mode 100644
index 00000000000..3e924ebd9d5
--- /dev/null
+++ b/app/assets/javascripts/mr_notes/init_count.js
@@ -0,0 +1,13 @@
+import store from '~/mr_notes/stores';
+
+export function initOverviewTabCounter() {
+ const discussionsCount = document.querySelector('.js-discussions-count');
+ store.watch(
+ (state, getters) => getters.discussionTabCounter,
+ (val) => {
+ if (typeof val !== 'undefined') {
+ discussionsCount.textContent = val;
+ }
+ },
+ );
+}