Commit a46ee4df authored by JC Brand's avatar JC Brand

Buttons aren't always there

parent 7c7002eb
...@@ -93,7 +93,12 @@ converse.plugins.add('converse-register', { ...@@ -93,7 +93,12 @@ converse.plugins.add('converse-register', {
if (_.isUndefined(this.registerlinkview)) { if (_.isUndefined(this.registerlinkview)) {
this.registerlinkview = new _converse.RegisterLinkView({'model': this.model}); this.registerlinkview = new _converse.RegisterLinkView({'model': this.model});
this.registerlinkview.render(); this.registerlinkview.render();
this.el.querySelector('.buttons').insertAdjacentElement('afterend', this.registerlinkview.el); const buttons = this.el.querySelector('.buttons');
// Might not exist, if the spinner is currently
// showing...
if (buttons) {
buttons.insertAdjacentElement('afterend', this.registerlinkview.el);
}
} }
this.registerlinkview.render(); this.registerlinkview.render();
} }
...@@ -122,10 +127,10 @@ converse.plugins.add('converse-register', { ...@@ -122,10 +127,10 @@ converse.plugins.add('converse-register', {
}); });
this.registerpanel.render(); this.registerpanel.render();
this.registerpanel.el.classList.add('hidden'); this.registerpanel.el.classList.add('hidden');
this.el.querySelector('#converse-login-panel').insertAdjacentElement( const login_panel = this.el.querySelector('#converse-login-panel');
'afterend', if (login_panel) {
this.registerpanel.el login_panel.insertAdjacentElement('afterend', this.registerpanel.el);
); }
this.showLoginOrRegisterForm(); this.showLoginOrRegisterForm();
} }
return this; return this;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment