1 import {Component} from './component';
3 export class NewUserPassword extends Component {
6 this.container = this.$el;
7 this.inputContainer = this.$refs.inputContainer;
8 this.inviteOption = this.container.querySelector('input[name=send_invite]');
10 if (this.inviteOption) {
11 this.inviteOption.addEventListener('change', this.inviteOptionChange.bind(this));
12 this.inviteOptionChange();
16 inviteOptionChange() {
17 const inviting = (this.inviteOption.value === 'true');
18 const passwordBoxes = this.container.querySelectorAll('input[type=password]');
19 for (const input of passwordBoxes) {
20 input.disabled = inviting;
23 this.inputContainer.style.display = inviting ? 'none' : 'block';