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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 12:55:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 12:55:51 +0300
commite8d2c2579383897a1dd7f9debd359abe8ae8373d (patch)
treec42be41678c2586d49a75cabce89322082698334 /app/assets/javascripts/right_sidebar.js
parentfc845b37ec3a90aaa719975f607740c22ba6a113 (diff)
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'app/assets/javascripts/right_sidebar.js')
-rw-r--r--app/assets/javascripts/right_sidebar.js40
1 files changed, 5 insertions, 35 deletions
diff --git a/app/assets/javascripts/right_sidebar.js b/app/assets/javascripts/right_sidebar.js
index 6cdd89ad431..36f5e6f4ce1 100644
--- a/app/assets/javascripts/right_sidebar.js
+++ b/app/assets/javascripts/right_sidebar.js
@@ -2,8 +2,8 @@
import $ from 'jquery';
import Cookies from 'js-cookie';
-import { fixTitle, hide } from '~/tooltips';
-import { deprecatedCreateFlash as flash } from './flash';
+import { hide } from '~/tooltips';
+import createFlash from './flash';
import axios from './lib/utils/axios_utils';
import { sprintf, s__, __ } from './locale';
@@ -98,45 +98,15 @@ Sidebar.prototype.toggleTodo = function (e) {
this.todoUpdateDone(data);
})
.catch(() =>
- flash(
- sprintf(__('There was an error %{message} todo.'), {
+ createFlash({
+ message: sprintf(__('There was an error %{message} todo.'), {
message:
ajaxType === 'post' ? s__('RightSidebar|adding a') : s__('RightSidebar|deleting the'),
}),
- ),
+ }),
);
};
-Sidebar.prototype.todoUpdateDone = function (data) {
- const deletePath = data.delete_path ? data.delete_path : null;
- const attrPrefix = deletePath ? 'mark' : 'todo';
- const $todoBtns = $('.js-issuable-todo');
-
- $(document).trigger('todo:toggle', data.count);
-
- $todoBtns.each((i, el) => {
- const $el = $(el);
- const $elText = $el.find('.js-issuable-todo-inner');
-
- $el
- .removeClass('is-loading')
- .enable()
- .attr('aria-label', $el.data(`${attrPrefix}Text`))
- .attr('title', $el.data(`${attrPrefix}Text`))
- .data('deletePath', deletePath);
-
- if ($el.hasClass('has-tooltip')) {
- fixTitle(el);
- }
-
- if (typeof $el.data('isCollapsed') !== 'undefined') {
- $elText.html($el.data(`${attrPrefix}Icon`));
- } else {
- $elText.text($el.data(`${attrPrefix}Text`));
- }
- });
-};
-
Sidebar.prototype.sidebarCollapseClicked = function (e) {
if ($(e.currentTarget).hasClass('dont-change-state')) {
return;