Skip to content

Commit

Permalink
feat(riot-mui): now we can CTRL + click on catalog elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Joxit committed Dec 29, 2022
1 parent 696aa39 commit 228762c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/components/catalog/catalog-element.riot
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
if="{!props.filterResults || state.nImages > 0 || matchSearch(props.filterResults, state.image)}"
>
<material-card class="list highlight" expanded="{state.expanded}" onclick="{ onClick }">
<material-waves center="true" color="#ddd"></material-waves>
<a if="{ state.image }" href="{ router.taglist(state.image) }">
<material-waves center="true" color="#ddd"></material-waves>
</a>
<material-waves if="{ state.images }" center="true" color="#ddd"></material-waves>
<span>
<i class="material-icons">send</i>
{ state.image || state.repo }
Expand Down Expand Up @@ -76,9 +79,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
},
onClick() {
const state = this.state;
if (!state.repo) {
router.goTaglist(state.image);
} else {
if (state.repo) {
this.update({
expanded: !this.state.expanded,
expanding: true,
Expand Down Expand Up @@ -112,6 +113,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
oReq.send();
},
matchSearch,
router,
};
</script>
<!-- End of tag -->
Expand Down
5 changes: 1 addition & 4 deletions src/scripts/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { router, getCurrentRoute } from '@riotjs/route';
import { getCurrentRoute } from '@riotjs/route';
import { encodeURI, decodeURI } from './utils';

function getQueryParams() {
Expand Down Expand Up @@ -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\//, '');
},
Expand Down

0 comments on commit 228762c

Please sign in to comment.