Commit c7a0ff19 authored by Phil Hughes's avatar Phil Hughes

Fixed multiple boards new form scrolling

When the milestone dropdown is open, it isn't very obvious that you need to scroll.
This fixes that by taking the dropdown out of the other dropdown

Closes #1897
parent 8798c886
......@@ -59,9 +59,20 @@ const extraMilestones = require('../mixins/extra_milestones');
},
},
methods: {
loadMilestones() {
loadMilestones(e) {
this.milestoneDropdownOpen = !this.milestoneDropdownOpen;
BoardService.loadMilestones.call(this);
if (this.milestoneDropdownOpen) {
this.$nextTick(() => {
const milestoneDropdown = this.$refs.milestoneDropdown;
const rect = e.target.getBoundingClientRect();
milestoneDropdown.style.left = `${rect.left}px`;
milestoneDropdown.style.top = `${rect.bottom}px`;
milestoneDropdown.style.width = `${rect.width}px`;
});
}
},
submit() {
gl.boardService.createBoard(this.board)
......
......@@ -574,8 +574,7 @@
margin-top: 10px;
.dropdown-menu {
top: 60px;
min-width: 100%;
position: fixed;
}
}
......
......@@ -14,10 +14,11 @@
%label.label-light{ for: "board-milestone" }
Board milestone
%button.dropdown-menu-toggle.wide{ type: "button",
"@click.stop.prevent" => "loadMilestones" }
"@click.stop.prevent" => "loadMilestones($event)" }
{{ milestoneToggleText }}
= icon("chevron-down")
.dropdown-menu.dropdown-menu-selectable{ "v-if" => "milestoneDropdownOpen" }
.dropdown-menu.dropdown-menu-selectable{ "v-if" => "milestoneDropdownOpen",
ref: "milestoneDropdown" }
.dropdown-content
%ul
%li{ "v-for" => "milestone in extraMilestones" }
......
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