import './style.scss';

export default new Class({
	Extends: Hedera.Form,
	Template: require('./ui.xml')

	,rendererFunc(scope, form) {
		var isEnabled = form.$.active
		scope.$.disabled.style.display = isEnabled ?
			'none' : 'block';
		scope.$.impersonate.node.style.display = isEnabled ?
			'block' : 'none';
	}

	,async onChangeUserClick(userName) {
		await this.gui.supplantUser(userName);
		this.hash.setAll({form: 'ecomerce/orders'});
	}
});

