gitlab-org--gitlab-foss/app/assets/javascripts/group.js
2018-03-09 15:18:09 -06:00

23 lines
594 B
JavaScript

import $ from 'jquery';
export default class Group {
constructor() {
this.groupPath = $('#group_path');
this.groupName = $('#group_name');
this.updateHandler = this.update.bind(this);
this.resetHandler = this.reset.bind(this);
if (this.groupName.val() === '') {
this.groupPath.on('keyup', this.updateHandler);
this.groupName.on('keydown', this.resetHandler);
}
}
update() {
this.groupName.val(this.groupPath.val());
}
reset() {
this.groupPath.off('keyup', this.updateHandler);
this.groupName.off('keydown', this.resetHandler);
}
}