Skip to content

Commit

Permalink
close #135 + cmd+click for mac
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Jul 27, 2024
1 parent 475f321 commit d6b74b7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pages/contribution/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
class="pt-0 my-0"
height="100%"
:placeholder="$root.lang().database.labels.search_texture"
@keydown.enter="startSearch()"
@keyup.enter="startSearch()"
hide-details
/>
</v-col>
Expand Down
4 changes: 3 additions & 1 deletion pages/gallery/gallery-grid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
:key="sort + texture.textureID"
:style="styles.cell"
class="gallery-texture-in-container"
@click.stop="$emit('changeShareURL', texture.textureID)"
@click.exact.stop="$emit('open', texture.textureID)"
@click.middle.stop="$emit('openNewTab', texture.textureID)"
@click.meta.stop="$emit('openNewTab', texture.textureID)"
>
<tippy :to="texture.id" placement="right-start" theme="" maxWidth="350px">
<template #trigger>
Expand Down
15 changes: 10 additions & 5 deletions pages/gallery/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@
:ignoreList="ignoreList"
:discordIDtoName="discordIDtoName"
:sort="currentSort"
@changeShareURL="changeShareURL"
@open="changeShareURL"
@openNewTab="newTabShareURL"
/>

<gallery-modal
Expand Down Expand Up @@ -226,8 +227,8 @@ export default {
return "faithful_64x";
}
},
changeShareURL(id, copyURL = false) {
if (!copyURL && id !== undefined) this.$router.push({ query: { show: id } });
changeShareURL(id, update = true) {
if (update && id !== undefined) this.$router.push({ query: { show: id } });
// need location api to get base url to share
const showIndex = location.href.indexOf("?show=");
Expand All @@ -241,11 +242,15 @@ export default {
removeShareURL() {
this.$router.push({ query: null });
},
copyShareLink(id) {
const url = this.changeShareURL(id, true);
copyShareURL(id) {
const url = this.changeShareURL(id, false);
navigator.clipboard.writeText(url);
this.$root.showSnackBar(this.$root.lang("gallery.share_link_copied_to_clipboard"), "success");
},
newTabShareURL(id) {
const url = this.changeShareURL(id, false);
window.open(url, "_blank");
},
openModal(id) {
this.modalTextureID = id;
this.modalTextureObj = {}; // changes text back to loading text if reopening modal
Expand Down

0 comments on commit d6b74b7

Please sign in to comment.