xmpp.chapril.org-conversejs/mockup/controlbox.js

25 lines
827 B
JavaScript
Raw Normal View History

2018-01-22 07:37:20 +01:00
/*global Backbone, _, window */
const UserPanel = Backbone.NativeView.extend({
el: '.controlbox-pane',
2018-01-22 07:37:20 +01:00
initialize () {
this.render();
},
render () {
const xhr = new XMLHttpRequest();
xhr.open('GET', 'controlbox.html', true);
2018-01-22 07:37:20 +01:00
xhr.onload = () => {
this.el.innerHTML = xhr.responseText;
2018-01-22 16:18:52 +01:00
this.modals = _.map(this.el.querySelectorAll('[data-toggle="modal"]'), (modal_el) =>
new window.Modal(modal_el, {
backdrop: 'static', // we don't want to dismiss Modal when Modal or backdrop is the click event target
keyboard: true // we want to dismiss Modal on pressing Esc key
}));
2018-04-26 19:10:06 +02:00
window.renderAvatars();
window.initSpoilers();
2018-01-22 07:37:20 +01:00
}
xhr.send();
}
});