From 486212f22a0f75da9abd1fdd7586c8afe566f855 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Wed, 14 Jun 2023 16:39:08 +0000 Subject: [PATCH] Fix expanding messages on the search tab. Maybe this should happen at another level. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4321 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- apps/ssb/tf-tab-search.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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)}> - + `; } }