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/vue_shared/components/sidebar/todo_toggle/todo_button.vue')
-rw-r--r--app/assets/javascripts/vue_shared/components/sidebar/todo_toggle/todo_button.vue18
1 files changed, 3 insertions, 15 deletions
diff --git a/app/assets/javascripts/vue_shared/components/sidebar/todo_toggle/todo_button.vue b/app/assets/javascripts/vue_shared/components/sidebar/todo_toggle/todo_button.vue
index e6229cf0a93..cdc7422c7df 100644
--- a/app/assets/javascripts/vue_shared/components/sidebar/todo_toggle/todo_button.vue
+++ b/app/assets/javascripts/vue_shared/components/sidebar/todo_toggle/todo_button.vue
@@ -1,6 +1,6 @@
<script>
import { GlButton } from '@gitlab/ui';
-import { todoLabel } from './utils';
+import { todoLabel, updateGlobalTodoCount } from './utils';
export default {
components: {
@@ -19,23 +19,11 @@ export default {
},
},
methods: {
- updateGlobalTodoCount(additionalTodoCount) {
- const countContainer = document.querySelector('.js-todos-count');
- if (countContainer === null) return;
- const currentCount = parseInt(countContainer.innerText, 10);
- const todoToggleEvent = new CustomEvent('todo:toggle', {
- detail: {
- count: Math.max(currentCount + additionalTodoCount, 0),
- },
- });
-
- document.dispatchEvent(todoToggleEvent);
- },
incrementGlobalTodoCount() {
- this.updateGlobalTodoCount(1);
+ updateGlobalTodoCount(1);
},
decrementGlobalTodoCount() {
- this.updateGlobalTodoCount(-1);
+ updateGlobalTodoCount(-1);
},
onToggle(event) {
if (this.isTodo) {