Commit 6dfd0d1a authored by JC Brand's avatar JC Brand

Make sure popovers also work in overlay view mode

parent be99af4f
...@@ -9938,6 +9938,9 @@ body.reset { ...@@ -9938,6 +9938,9 @@ body.reset {
#conversejs.converse-overlayed #controlbox .box-flyout { #conversejs.converse-overlayed #controlbox .box-flyout {
min-width: 250px !important; min-width: 250px !important;
width: 250px; } width: 250px; }
#conversejs.converse-overlayed #controlbox .login-trusted {
white-space: nowrap;
font-size: 90%; }
#conversejs.converse-overlayed #controlbox #converse-login-trusted { #conversejs.converse-overlayed #controlbox #converse-login-trusted {
margin-top: 0.5em; } margin-top: 0.5em; }
#conversejs.converse-overlayed #controlbox:not(.logged-out) .controlbox-head { #conversejs.converse-overlayed #controlbox:not(.logged-out) .controlbox-head {
......
...@@ -62478,6 +62478,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -62478,6 +62478,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
this.loginpanel.render(); this.loginpanel.render();
} }
this.loginpanel.initPopovers();
return this; return this;
}, },
...@@ -62588,14 +62589,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -62588,14 +62589,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
this.model.on('change', this.render, this); this.model.on('change', this.render, this);
this.listenTo(_converse.connfeedback, 'change', this.render); this.listenTo(_converse.connfeedback, 'change', this.render);
this.render(); this.render();
_.forEach(this.el.querySelectorAll('[data-title]'), el => {
const popover = new bootstrap.Popover(el, {
'trigger': _converse.view_mode === 'mobile' && 'click' || 'hover',
'dismissible': _converse.view_mode === 'mobile' && true || false,
'container': _converse.chatboxviews.el
});
});
}, },
toHTML() { toHTML() {
...@@ -62625,6 +62618,16 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -62625,6 +62618,16 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
})); }));
}, },
initPopovers() {
_.forEach(this.el.querySelectorAll('[data-title]'), el => {
const popover = new bootstrap.Popover(el, {
'trigger': _converse.view_mode === 'mobile' && 'click' || 'hover',
'dismissible': _converse.view_mode === 'mobile' && true || false,
'container': this.el.parentElement.parentElement.parentElement
});
});
},
validate() { validate() {
const form = this.el.querySelector('form'); const form = this.el.querySelector('form');
const jid_element = form.querySelector('input[name=jid]'); const jid_element = form.querySelector('input[name=jid]');
...@@ -73944,7 +73947,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -73944,7 +73947,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
'allow_registration': true, 'allow_registration': true,
'domain_placeholder': __(" e.g. conversejs.org"), 'domain_placeholder': __(" e.g. conversejs.org"),
// Placeholder text shown in the domain input on the registration form // Placeholder text shown in the domain input on the registration form
'providers_link': 'https://xmpp.net/directory.php', 'providers_link': 'https://compliance.conversations.im/',
// Link to XMPP providers shown on registration page // Link to XMPP providers shown on registration page
'registration_domain': '' 'registration_domain': ''
}); });
...@@ -74172,8 +74175,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -74172,8 +74175,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
} }
this.reset({ this.reset({
domain: Strophe.getDomainFromJid(domain_name), 'domain': Strophe.getDomainFromJid(domain_name),
_registering: true '_registering': true
}); });
_converse.connection.connect(this.domain, "", this.onConnectStatusChanged.bind(this)); _converse.connection.connect(this.domain, "", this.onConnectStatusChanged.bind(this));
...@@ -352,6 +352,11 @@ ...@@ -352,6 +352,11 @@
width: $controlbox-width; width: $controlbox-width;
} }
.login-trusted {
white-space: nowrap;
font-size: 90%;
}
#converse-login-trusted { #converse-login-trusted {
margin-top: 0.5em; margin-top: 0.5em;
} }
......
...@@ -288,6 +288,7 @@ ...@@ -288,6 +288,7 @@
} else { } else {
this.loginpanel.render(); this.loginpanel.render();
} }
this.loginpanel.initPopovers();
return this; return this;
}, },
...@@ -388,13 +389,6 @@ ...@@ -388,13 +389,6 @@
this.model.on('change', this.render, this); this.model.on('change', this.render, this);
this.listenTo(_converse.connfeedback, 'change', this.render); this.listenTo(_converse.connfeedback, 'change', this.render);
this.render(); this.render();
_.forEach(this.el.querySelectorAll('[data-title]'), (el) => {
const popover = new bootstrap.Popover(el, {
'trigger': _converse.view_mode === 'mobile' && 'click' || 'hover',
'dismissible': _converse.view_mode === 'mobile' && true || false,
'container': _converse.chatboxviews.el
})
});
}, },
toHTML () { toHTML () {
...@@ -424,6 +418,16 @@ ...@@ -424,6 +418,16 @@
); );
}, },
initPopovers () {
_.forEach(this.el.querySelectorAll('[data-title]'), el => {
const popover = new bootstrap.Popover(el, {
'trigger': _converse.view_mode === 'mobile' && 'click' || 'hover',
'dismissible': _converse.view_mode === 'mobile' && true || false,
'container': this.el.parentElement.parentElement.parentElement
})
});
},
validate () { validate () {
const form = this.el.querySelector('form'); const form = this.el.querySelector('form');
const jid_element = form.querySelector('input[name=jid]'); const jid_element = form.querySelector('input[name=jid]');
......
...@@ -198,9 +198,7 @@ ...@@ -198,9 +198,7 @@
'domain_placeholder': _converse.domain_placeholder 'domain_placeholder': _converse.domain_placeholder
}); });
if (_converse.registration_domain) { if (_converse.registration_domain) {
this.fetchRegistrationForm( this.fetchRegistrationForm(_converse.registration_domain);
_converse.registration_domain
);
} }
return this; return this;
}, },
...@@ -353,12 +351,10 @@ ...@@ -353,12 +351,10 @@
this.renderRegistrationRequest(); this.renderRegistrationRequest();
} }
this.reset({ this.reset({
domain: Strophe.getDomainFromJid(domain_name), 'domain': Strophe.getDomainFromJid(domain_name),
_registering: true '_registering': true
}); });
_converse.connection.connect( _converse.connection.connect(this.domain, "", this.onConnectStatusChanged.bind(this));
this.domain, "", this.onConnectStatusChanged.bind(this)
);
return false; return false;
}, },
...@@ -381,10 +377,7 @@ ...@@ -381,10 +377,7 @@
feedback.parentNode.removeChild(feedback); feedback.parentNode.removeChild(feedback);
} }
const form = this.el.querySelector('form'); const form = this.el.querySelector('form');
form.insertAdjacentHTML( form.insertAdjacentHTML('afterbegin', '<span class="reg-feedback"></span>');
'afterbegin',
'<span class="reg-feedback"></span>'
);
feedback = form.querySelector('.reg-feedback'); feedback = form.querySelector('.reg-feedback');
feedback.textContent = message; feedback.textContent = message;
if (klass) { if (klass) {
......
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