Commit 888cbe90 authored by Phil Hughes's avatar Phil Hughes Committed by Douglas Barbosa Alexandre

Fixed issue with milestone dropdown not reseting state

parent 72fc4059
......@@ -95,13 +95,19 @@ require('./board_new_form');
}
},
updateMilestoneFilterDropdown() {
const $milestoneDropdownToggle = $('.js-milestone-select');
const glDropdown = $milestoneDropdownToggle.data('glDropdown');
const $milestoneDropdown = $('.dropdown-menu-milestone');
const hideElements = this.board.milestone === undefined || this.board.milestone_id === -1;
const hideElements = this.board.milestone === undefined || this.board.milestone_id === null;
if (glDropdown.fullData) {
glDropdown.parseData(glDropdown.fullData);
}
$milestoneDropdown.find('.dropdown-input, .dropdown-footer-list')
.toggle(hideElements);
$milestoneDropdown.find('.js-milestone-footer-content').toggle(!hideElements);
$milestoneDropdown.find('.dropdown-content li')
$milestoneDropdown.find('.dropdown-content li').show()
.filter((i, el) => $(el).find('.is-active').length === 0)
.toggle(hideElements);
......
......@@ -554,7 +554,12 @@
index = false;
}
html = document.createElement('li');
if ((data === 'divider' || data === 'separator') && !rowHidden) {
if (rowHidden) {
html.style.display = 'none';
}
if ((data === 'divider' || data === 'separator')) {
html.className = data;
return html;
}
......@@ -606,10 +611,6 @@
link.dataset.index = index;
}
if (rowHidden) {
link.style.display = 'none';
}
html.appendChild(link);
}
return html;
......
......@@ -121,7 +121,7 @@
vue: $dropdown.hasClass('js-issue-board-sidebar'),
hideRow: function(milestone) {
if ($('html').hasClass('issue-boards-page') && !$dropdown.hasClass('js-issue-board-sidebar') &&
!$dropdown.closest('.add-issues-modal').length && gl.issueBoards.BoardsStore.state.currentBoard.milestone_id) {
!$dropdown.closest('.add-issues-modal').length && gl.issueBoards.BoardsStore.state.currentBoard.milestone) {
return milestone !== gl.issueBoards.BoardsStore.state.currentBoard.milestone.title;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment