Skip to content
Snippets Groups Projects

Resolve "Customize branch name when using create branch in an issue"

All threads resolved!
Compare and Show latest version
4 files
+ 39
44
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -65,7 +65,6 @@ export default class CreateMergeRequestDropdown {
bindEvents() {
this.createMergeRequestButton.addEventListener('click', this.onClickCreateMergeRequestButton.bind(this));
this.createTargetButton.addEventListener('click', this.onClickCreateMergeRequestButton.bind(this));
this.dropdownToggle.addEventListener('click', this.onClickSetFocusOnBranchNameInput.bind(this));
this.branchInput.addEventListener('keyup', this.onChangeInput.bind(this));
this.refInput.addEventListener('keyup', this.onChangeInput.bind(this));
this.refInput.addEventListener('keydown', CreateMergeRequestDropdown.processTab.bind(this));
@@ -249,8 +248,7 @@ export default class CreateMergeRequestDropdown {
initDroplab() {
this.droplab = new DropLab();
this.droplab.init(this.dropdownToggle, this.dropdownList, [InputSetter],
this.getDroplabConfig());
this.droplab.init(this.dropdownToggle, this.dropdownList, [InputSetter], this.getDroplabConfig());
}
isBusy() {
@@ -300,17 +298,17 @@ export default class CreateMergeRequestDropdown {
return true;
}
onClickCreateMergeRequestButton(e) {
onClickCreateMergeRequestButton(event) {
let xhr = null;
e.preventDefault();
event.preventDefault();
if (this.isBusy()) {
return;
}
if (e.target.dataset.action === CREATE_MERGE_REQUEST) {
if (event.target.dataset.action === CREATE_MERGE_REQUEST) {
xhr = this.createMergeRequest();
} else if (e.target.dataset.action === CREATE_BRANCH) {
} else if (event.target.dataset.action === CREATE_BRANCH) {
xhr = this.createBranch();
}
@@ -324,10 +322,6 @@ export default class CreateMergeRequestDropdown {
this.disable();
}
onClickSetFocusOnBranchNameInput() {
this.branchInput.focus();
}
// `TAB` autocompletes the source.
static processTab(event) {
if (event.keyCode !== 9) return;
Loading