Skip to content
Snippets Groups Projects
Commit ae10b0a8 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

add copy shared link button and paste to clipboard

parent 22a33137
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,6 @@ import Index from '../views/Index.vue' ...@@ -5,7 +5,6 @@ import Index from '../views/Index.vue'
Vue.use(VueRouter) Vue.use(VueRouter)
let projectBase = "projet" let projectBase = "projet"
console.log("window.location.pathname", window.location.pathname)
if (window.location.pathname.includes("projet-partage")) { if (window.location.pathname.includes("projet-partage")) {
projectBase = "projet-partage" projectBase = "projet-partage"
} }
......
...@@ -93,6 +93,11 @@ ...@@ -93,6 +93,11 @@
> >
<i class="inverted grey pencil alternate icon"></i> <i class="inverted grey pencil alternate icon"></i>
</router-link> </router-link>
<button
v-if="!$route.path.includes('projet-partage')" class="ui button teal" @click="copyLink">
<i class="ui icon clipboard"></i>
Copier le lien de partage
</button>
</div> </div>
<div class="ui hidden divider"></div> <div class="ui hidden divider"></div>
<div class="sub header"> <div class="sub header">
...@@ -809,6 +814,16 @@ export default { ...@@ -809,6 +814,16 @@ export default {
return false; return false;
}, },
copyLink() {
const sharedLink = window.location.href.replace("projet", "projet-partage");
navigator.clipboard.writeText(sharedLink).then(()=> {
console.log("success")
}, () => {
console.log("failed")
}
)
},
checkForOfflineFeature() { checkForOfflineFeature() {
let arraysOffline = []; let arraysOffline = [];
let localStorageArray = localStorage.getItem("geocontrib_offline"); let localStorageArray = localStorage.getItem("geocontrib_offline");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment