2a4241641c
This commit introduces timer-less retry system: 1. Any change to URL is going to stop listening to any messages. 2. If a message is sent and there's no handler that could pick it up, the message gets enqueued. 3. The message is sent again to the first handler that attaches itself to given event type. While in theory this is full of holes (no control over the first handler), in practice, it works quite well. Additionally, views.listenToMessages was attaching to completely wrong DOM node; this commit fixes this as well.
18 lines
416 B
JavaScript
18 lines
416 B
JavaScript
'use strict';
|
|
|
|
const views = require('../util/views.js');
|
|
|
|
class EmptyView {
|
|
constructor() {
|
|
this.template = views.htmlToDom('<div class="messages"></div>');
|
|
}
|
|
|
|
render(ctx) {
|
|
const target = document.getElementById('content-holder');
|
|
const source = this.template;
|
|
views.listenToMessages(source);
|
|
views.showView(target, source);
|
|
}
|
|
}
|
|
|
|
module.exports = EmptyView;
|