Sfoglia il codice sorgente

:bug: #50 | handling hrefs from blocks

tags/0.9.0
J 4 anni fa
parent
commit
d87e389b5d
1 ha cambiato i file con 7 aggiunte e 1 eliminazioni
  1. 7
    1
      vue-theme/src/components/content-block/block.vue

+ 7
- 1
vue-theme/src/components/content-block/block.vue Vedi File

@@ -37,7 +37,13 @@ export default {
37 37
             return `https://www.youtube.com/embed/${videoUid}`
38 38
         },
39 39
         openGallery(e) {
40
-            this.$emit('open-gallery', e.target)
40
+            if(e.target.tagName === 'IMG') {
41
+                this.$emit('open-gallery', e.target)
42
+            } else {
43
+                if(e.target.dataset.type === 'URL') {
44
+                    window.open(e.target.href)
45
+                }
46
+            }
41 47
         }
42 48
     },
43 49
     data() {

Loading…
Annulla
Salva