From 228762c6415deb5a2bbf632f2cad0d8b41772549 Mon Sep 17 00:00:00 2001 From: Joxit Date: Thu, 29 Dec 2022 23:50:47 +0100 Subject: [PATCH] feat(riot-mui): now we can CTRL + click on catalog elements --- src/components/catalog/catalog-element.riot | 10 ++++++---- src/scripts/router.js | 5 +---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/catalog/catalog-element.riot b/src/components/catalog/catalog-element.riot index 43a4823..234385a 100644 --- a/src/components/catalog/catalog-element.riot +++ b/src/components/catalog/catalog-element.riot @@ -21,7 +21,10 @@ along with this program. If not, see . if="{!props.filterResults || state.nImages > 0 || matchSearch(props.filterResults, state.image)}" > - + + + + send { state.image || state.repo } @@ -76,9 +79,7 @@ along with this program. If not, see . }, onClick() { const state = this.state; - if (!state.repo) { - router.goTaglist(state.image); - } else { + if (state.repo) { this.update({ expanded: !this.state.expanded, expanding: true, @@ -112,6 +113,7 @@ along with this program. If not, see . oReq.send(); }, matchSearch, + router, }; diff --git a/src/scripts/router.js b/src/scripts/router.js index 3134f14..58c9bfb 100644 --- a/src/scripts/router.js +++ b/src/scripts/router.js @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -import { router, getCurrentRoute } from '@riotjs/route'; +import { getCurrentRoute } from '@riotjs/route'; import { encodeURI, decodeURI } from './utils'; function getQueryParams() { @@ -64,9 +64,6 @@ export default { taglist(image) { return `${baseUrl({ page: null })}#!/taglist/${image}`; }, - goTaglist(image) { - router.push(`${baseUrl({ page: null })}#!/taglist/${image}`); - }, getTagListImage() { return getCurrentRoute().replace(/^.*(#!)?\/?taglist\//, ''); },