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:
authorPhil Hughes <me@iamphill.com>2016-10-07 18:18:42 +0300
committerPhil Hughes <me@iamphill.com>2016-11-04 13:25:47 +0300
commit277712cc670684ed6df162f810f860215da2a7ee (patch)
tree0fcf7dd5e19cb0d66bad60505cfca422e28d3a0f /app/assets
parent957744dab4297f66dc70c1727fe2cf5282d2ea5a (diff)
Creates new list from a new label
Closes #23026
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/boards/components/new_list_dropdown.js.es613
-rw-r--r--app/assets/javascripts/create_label.js.es62
2 files changed, 15 insertions, 0 deletions
diff --git a/app/assets/javascripts/boards/components/new_list_dropdown.js.es6 b/app/assets/javascripts/boards/components/new_list_dropdown.js.es6
index fe1a6dc7ea0..14f618fd5d5 100644
--- a/app/assets/javascripts/boards/components/new_list_dropdown.js.es6
+++ b/app/assets/javascripts/boards/components/new_list_dropdown.js.es6
@@ -2,6 +2,19 @@
$(() => {
const Store = gl.issueBoards.BoardsStore;
+ $(document).off('created.label').on('created.label', (e, label) => {
+ Store.new({
+ title: label.title,
+ position: Store.state.lists.length - 2,
+ list_type: 'label',
+ label: {
+ id: label.id,
+ title: label.title,
+ color: label.color
+ }
+ });
+ });
+
$('.js-new-board-list').each(function () {
const $this = $(this);
new gl.CreateLabelDropdown($this.closest('.dropdown').find('.dropdown-new-label'), $this.data('namespace-path'), $this.data('project-path'));
diff --git a/app/assets/javascripts/create_label.js.es6 b/app/assets/javascripts/create_label.js.es6
index f20580b1279..744aa0afa03 100644
--- a/app/assets/javascripts/create_label.js.es6
+++ b/app/assets/javascripts/create_label.js.es6
@@ -115,6 +115,8 @@
.show();
} else {
this.$dropdownBack.trigger('click');
+
+ $(document).trigger('created.label', label);
}
});
}