From: Scott Worley Date: Fri, 20 Oct 2023 21:28:58 +0000 (-0700) Subject: Split setTagView() to factor out setTagFilter() X-Git-Url: http://git.scottworley.com/vopamoi/commitdiff_plain/06c452120f001ffee11ae5b80263fc1ed4fea481 Split setTagView() to factor out setTagFilter() --- diff --git a/vopamoi.ts b/vopamoi.ts index c72884e..1d357bd 100644 --- a/vopamoi.ts +++ b/vopamoi.ts @@ -611,13 +611,7 @@ function BrowserUI() { return ui.setState(createTimestamp, newState, oldState); }, - setTagView: function (tag: string | null = null) { - if (tag === null) { - const target = this.currentTag(); - if (!target) return; - tag = target.textContent!; - } - + setTagFilter: function (tag: string) { if (currentTagFilter !== null) { this.resetTagView(); } @@ -659,6 +653,15 @@ function BrowserUI() { this.setTitle(); }, + setTagView: function (tag: string | null = null) { + if (tag === null) { + const target = this.currentTag(); + if (!target) return; + tag = target.textContent!; + } + this.setTagFilter(tag); + }, + setTitle: function () { document.title = "Vopamoi: " + currentViewState + (currentTagFilter ? ": " + currentTagFilter : ""); },