1
1
<script setup>
2
2
/** Right click pop up which shows the coordinates of the position under the cursor. */
3
3
4
- // importing directly the vue component, see https://github.com/ivanvermeyen/vue-collapse-transition/issues/5
5
4
import tippy from ' tippy.js'
6
5
import { computed , onBeforeUnmount , onMounted , ref , watch } from ' vue'
7
6
import { useI18n } from ' vue-i18n'
@@ -18,17 +17,17 @@ import { stringifyQuery } from '@/utils/url-router'
18
17
19
18
const i18n = useI18n ()
20
19
const store = useStore ()
20
+ const route = useRoute ()
21
21
22
22
const clickInfo = computed (() => store .state .map .clickInfo )
23
23
const projection = computed (() => store .state .position .projection )
24
24
const showIn3d = computed (() => store .state .cesium .active )
25
25
const currentLang = computed (() => store .state .i18n .lang )
26
+ const showEmbedSharing = computed (() => selectedTab .value === ' share' )
26
27
27
- const route = useRoute ()
28
28
const selectedTab = ref (' position' )
29
29
const shareTabButton = ref (null )
30
30
const newClickInfo = ref (true )
31
- const showEmbedSharing = ref (false )
32
31
const requestClipboard = ref (false )
33
32
const shareLinkCopied = ref (false )
34
33
const shareLinkUrl = ref (null )
79
78
updateShareLink ()
80
79
}
81
80
}
82
- console .log (' Query parameters changed:' , newQuery)
83
81
}
84
82
)
85
83
@@ -123,18 +121,16 @@ async function shortenShareLink(url) {
123
121
124
122
function onPositionTabClick () {
125
123
selectedTab .value = ' position'
126
- showEmbedSharing .value = false
127
124
newClickInfo .value = false
128
125
}
129
126
async function onShareTabClick () {
130
- selectedTab .value = ' share'
131
127
if (newClickInfo .value && showEmbedSharing .value == false ) {
132
128
// copyShareLink is called by watcher since new shortlink is computed with a delay
133
129
requestClipboard .value = true
134
130
} else {
135
131
copyShareLink ()
136
132
}
137
- showEmbedSharing .value = true
133
+ selectedTab .value = ' share '
138
134
newClickInfo .value = false
139
135
}
140
136
@@ -153,7 +149,6 @@ async function copyShareLink() {
153
149
154
150
function clearClick () {
155
151
store .dispatch (' clearClick' )
156
- showEmbedSharing .value = false
157
152
requestClipboard .value = false
158
153
}
159
154
< / script>
@@ -162,7 +157,7 @@ function clearClick() {
162
157
< component
163
158
: is= " mappingFrameworkSpecificPopup"
164
159
v- if = " coordinate"
165
- : title= " selectedTab == 'position' ? $ t('position') : $ t('link_bowl_crosshair')"
160
+ : title= " selectedTab == 'position' ? i18n. t('position') : i18n. t('link_bowl_crosshair')"
166
161
: coordinates= " coordinate"
167
162
: projection= " projection"
168
163
use- content- padding
@@ -184,7 +179,7 @@ function clearClick() {
184
179
: aria- selected= " selectedTab === 'position'"
185
180
@click= " onPositionTabClick()"
186
181
>
187
- {{ $ t (' position' ) }}
182
+ {{ i18n . t (' position' ) }}
188
183
< / button>
189
184
< / li>
190
185
< li class = " nav-item" role= " presentation" >
@@ -208,7 +203,8 @@ function clearClick() {
208
203
'': currentLang != 'it',
209
204
}"
210
205
>
211
- {{ $t (' link_bowl_crosshair' ) }} & nbsp;& nbsp;< FontAwesomeIcon
206
+ {{ i18n .t (' link_bowl_crosshair' ) }} & nbsp;& nbsp;< FontAwesomeIcon
207
+ data- cy= " location-popup-share-tab-check"
212
208
class = " px-0 icon"
213
209
: icon= " copyButtonIcon"
214
210
/ >
0 commit comments