Skip to content

Commit 228762c

Browse files
committed
feat(riot-mui): now we can CTRL + click on catalog elements
1 parent 696aa39 commit 228762c

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/components/catalog/catalog-element.riot

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2121
if="{!props.filterResults || state.nImages > 0 || matchSearch(props.filterResults, state.image)}"
2222
>
2323
<material-card class="list highlight" expanded="{state.expanded}" onclick="{ onClick }">
24-
<material-waves center="true" color="#ddd"></material-waves>
24+
<a if="{ state.image }" href="{ router.taglist(state.image) }">
25+
<material-waves center="true" color="#ddd"></material-waves>
26+
</a>
27+
<material-waves if="{ state.images }" center="true" color="#ddd"></material-waves>
2528
<span>
2629
<i class="material-icons">send</i>
2730
{ state.image || state.repo }
@@ -76,9 +79,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
7679
},
7780
onClick() {
7881
const state = this.state;
79-
if (!state.repo) {
80-
router.goTaglist(state.image);
81-
} else {
82+
if (state.repo) {
8283
this.update({
8384
expanded: !this.state.expanded,
8485
expanding: true,
@@ -112,6 +113,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
112113
oReq.send();
113114
},
114115
matchSearch,
116+
router,
115117
};
116118
</script>
117119
<!-- End of tag -->

src/scripts/router.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* You should have received a copy of the GNU Affero General Public License
1515
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*/
17-
import { router, getCurrentRoute } from '@riotjs/route';
17+
import { getCurrentRoute } from '@riotjs/route';
1818
import { encodeURI, decodeURI } from './utils';
1919

2020
function getQueryParams() {
@@ -64,9 +64,6 @@ export default {
6464
taglist(image) {
6565
return `${baseUrl({ page: null })}#!/taglist/${image}`;
6666
},
67-
goTaglist(image) {
68-
router.push(`${baseUrl({ page: null })}#!/taglist/${image}`);
69-
},
7067
getTagListImage() {
7168
return getCurrentRoute().replace(/^.*(#!)?\/?taglist\//, '');
7269
},

0 commit comments

Comments
 (0)