Skip to content
Snippets Groups Projects
Commit 6017dc37 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Fixed a minor UI bug

parent 5b175ac2
Branches
Tags
No related merge requests found
const statehandler = new StateHandler(); const statehandler = new StateHandler();
class App { class App {
constructor() { constructor() {
this.navigation = new Navigation(); this.navigation = new Navigation();
...@@ -14,7 +13,6 @@ class App { ...@@ -14,7 +13,6 @@ class App {
}); });
statehandler.init(); statehandler.init();
} }
render() { render() {
this.elem = function () { this.elem = function () {
var $$a = document.createElement('div'); var $$a = document.createElement('div');
...@@ -28,7 +26,6 @@ class App { ...@@ -28,7 +26,6 @@ class App {
}.call(this); }.call(this);
this.buffers.forEach(buffer => this.insert(buffer)); this.buffers.forEach(buffer => this.insert(buffer));
} }
search(query, sender, buffer, network, before, since) { search(query, sender, buffer, network, before, since) {
this.clear(); this.clear();
this.navigation.input.blur(); this.navigation.input.blur();
...@@ -51,25 +48,21 @@ class App { ...@@ -51,25 +48,21 @@ class App {
this.buffers.forEach(buffer => this.insert(buffer)); this.buffers.forEach(buffer => this.insert(buffer));
}); });
} }
clear() { clear() {
while (this.buffers.length) { while (this.buffers.length) {
const buffer = this.buffers.pop(); const buffer = this.buffers.pop();
this.resultContainer.removeChild(buffer.elem); this.resultContainer.removeChild(buffer.elem);
} }
} }
clearAll() { clearAll() {
this.clear(); this.clear();
this.navigation.historyView.clear(); this.navigation.historyView.clear();
statehandler.clear(); statehandler.clear();
} }
insert(buffer) { insert(buffer) {
this.resultContainer.appendChild(buffer.elem); this.resultContainer.appendChild(buffer.elem);
buffer.addEventListener('loadMore', () => this.bufferLoadMore(buffer)); buffer.addEventListener('loadMore', () => this.bufferLoadMore(buffer));
} }
bufferLoadMore(buffer) { bufferLoadMore(buffer) {
if (buffer.loading) if (buffer.loading)
return; return;
...@@ -85,7 +78,6 @@ class App { ...@@ -85,7 +78,6 @@ class App {
}); });
} }
} }
moment.locale(navigator.languages || navigator.language); moment.locale(navigator.languages || navigator.language);
const app = new App(); const app = new App();
document.body.insertBefore(app.elem, document.body.firstChild); document.body.insertBefore(app.elem, document.body.firstChild);
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment