Commit 2df84af0 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'issue-boards-milestone-dropdown-stop-scroll' into 'master'

Fixed multiple boards new form scrolling

Closes #1897

See merge request !1414
parents b60d81fb c7a0ff19
...@@ -59,9 +59,20 @@ const extraMilestones = require('../mixins/extra_milestones'); ...@@ -59,9 +59,20 @@ const extraMilestones = require('../mixins/extra_milestones');
}, },
}, },
methods: { methods: {
loadMilestones() { loadMilestones(e) {
this.milestoneDropdownOpen = !this.milestoneDropdownOpen; this.milestoneDropdownOpen = !this.milestoneDropdownOpen;
BoardService.loadMilestones.call(this); 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() { submit() {
gl.boardService.createBoard(this.board) gl.boardService.createBoard(this.board)
......
...@@ -574,8 +574,7 @@ ...@@ -574,8 +574,7 @@
margin-top: 10px; margin-top: 10px;
.dropdown-menu { .dropdown-menu {
top: 60px; position: fixed;
min-width: 100%;
} }
} }
......
...@@ -14,10 +14,11 @@ ...@@ -14,10 +14,11 @@
%label.label-light{ for: "board-milestone" } %label.label-light{ for: "board-milestone" }
Board milestone Board milestone
%button.dropdown-menu-toggle.wide{ type: "button", %button.dropdown-menu-toggle.wide{ type: "button",
"@click.stop.prevent" => "loadMilestones" } "@click.stop.prevent" => "loadMilestones($event)" }
{{ milestoneToggleText }} {{ milestoneToggleText }}
= icon("chevron-down") = icon("chevron-down")
.dropdown-menu.dropdown-menu-selectable{ "v-if" => "milestoneDropdownOpen" } .dropdown-menu.dropdown-menu-selectable{ "v-if" => "milestoneDropdownOpen",
ref: "milestoneDropdown" }
.dropdown-content .dropdown-content
%ul %ul
%li{ "v-for" => "milestone in extraMilestones" } %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