2018-03-09 15:18:59 -05:00
|
|
|
import $ from 'jquery';
|
|
|
|
|
2017-03-12 11:22:00 -04:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|