diff --git a/apps/ssb/tf-tab-search.js b/apps/ssb/tf-tab-search.js index 165e6f50..a1c7fb92 100644 --- a/apps/ssb/tf-tab-search.js +++ b/apps/ssb/tf-tab-search.js @@ -9,6 +9,7 @@ class TfTabSearchElement extends LitElement { users: {type: Object}, following: {type: Array}, query: {type: String}, + expanded: {type: Object}, }; } @@ -20,6 +21,7 @@ class TfTabSearchElement extends LitElement { this.whoami = null; this.users = {}; this.following = []; + this.expanded = {}; } async search(query) { @@ -55,8 +57,20 @@ class TfTabSearchElement extends LitElement { } } + on_expand(event) { + if (event.detail.expanded) { + let expand = {}; + expand[event.detail.id] = true; + this.expanded = Object.assign({}, this.expanded, expand); + } else { + delete this.expanded[event.detail.id]; + this.expanded = Object.assign({}, this.expanded); + } + } + render() { if (this.query !== this.last_query) { + this.last_query = this.query; this.search(this.query); } let self = this; @@ -65,7 +79,7 @@ class TfTabSearchElement extends LitElement { self.search(self.renderRoot.getElementById('search').value)}> - + `; } }