diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-10-31 22:42:22 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-10-31 22:42:22 +0000 |
commit | 59d4a6d81cb745c154928d4ad43ab0278da6bc94 (patch) | |
tree | 2971bbcb51f4c382da6f237011be68e023f08364 /app/assets/javascripts/boards/components/new_list_dropdown.js | |
parent | 4472f31c33227f34150226b04f4c597797bb1825 (diff) | |
parent | 31f26a9382a7dc20acc640ed8cad38ac66efa4f0 (diff) | |
download | gitlab-ce-59d4a6d81cb745c154928d4ad43ab0278da6bc94.tar.gz |
Merge branch 'prettify-all-remaining-things' into 'master'
Prettify remaining files with differences in CE and EE
See merge request gitlab-org/gitlab-ce!22702
Diffstat (limited to 'app/assets/javascripts/boards/components/new_list_dropdown.js')
-rw-r--r-- | app/assets/javascripts/boards/components/new_list_dropdown.js | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/app/assets/javascripts/boards/components/new_list_dropdown.js b/app/assets/javascripts/boards/components/new_list_dropdown.js index 2c2045f8901..f7016561f93 100644 --- a/app/assets/javascripts/boards/components/new_list_dropdown.js +++ b/app/assets/javascripts/boards/components/new_list_dropdown.js @@ -6,36 +6,41 @@ import _ from 'underscore'; import CreateLabelDropdown from '../../create_label'; import boardsStore from '../stores/boards_store'; -$(document).off('created.label').on('created.label', (e, label) => { - boardsStore.new({ - title: label.title, - position: boardsStore.state.lists.length - 2, - list_type: 'label', - label: { - id: label.id, +$(document) + .off('created.label') + .on('created.label', (e, label) => { + boardsStore.new({ title: label.title, - color: label.color, - }, + position: boardsStore.state.lists.length - 2, + list_type: 'label', + label: { + id: label.id, + title: label.title, + color: label.color, + }, + }); }); -}); export default function initNewListDropdown() { - $('.js-new-board-list').each(function () { + $('.js-new-board-list').each(function() { const $this = $(this); - new CreateLabelDropdown($this.closest('.dropdown').find('.dropdown-new-label'), $this.data('namespacePath'), $this.data('projectPath')); + new CreateLabelDropdown( + $this.closest('.dropdown').find('.dropdown-new-label'), + $this.data('namespacePath'), + $this.data('projectPath'), + ); $this.glDropdown({ data(term, callback) { - axios.get($this.attr('data-list-labels-path')) - .then(({ data }) => { - callback(data); - }); + axios.get($this.attr('data-list-labels-path')).then(({ data }) => { + callback(data); + }); }, - renderRow (label) { + renderRow(label) { const active = boardsStore.findList('title', label.title); const $li = $('<li />'); const $a = $('<a />', { - class: (active ? `is-active js-board-list-${active.id}` : ''), + class: active ? `is-active js-board-list-${active.id}` : '', text: label.title, href: '#', }); @@ -53,7 +58,7 @@ export default function initNewListDropdown() { selectable: true, multiSelect: true, containerSelector: '.js-tab-container-labels .dropdown-page-one .dropdown-content', - clicked (options) { + clicked(options) { const { e } = options; const label = options.selectedObj; e.preventDefault(); |