play with event listeners

This commit is contained in:
Nolan Lawson 2018-01-10 21:31:33 -08:00
parent e1ed7b466f
commit 3bba43ea17
1 changed files with 21 additions and 3 deletions

View File

@ -1,7 +1,7 @@
<article> <article on:click="alert(event)">
{{#if status.reblog}} {{#if status.reblog}}
<div class="header"> <div class="header">
{{status.account.username}} boosted <a href="{{status.account.url}}">{{status.account.username}}</a> boosted
</div> </div>
{{/if}} {{/if}}
<div class="sidebar"> <div class="sidebar">
@ -26,6 +26,7 @@
<style> <style>
article { article {
pointer-events: none;
padding: 10px 0; padding: 10px 0;
max-width: 600px; max-width: 600px;
margin: 0 auto; margin: 0 auto;
@ -51,6 +52,15 @@
white-space: pre-wrap; white-space: pre-wrap;
} }
:global(.content a) {
pointer-events: auto;
}
:global(.header a) {
pointer-events: auto;
color: #333;
}
.header { .header {
grid-area: header; grid-area: header;
margin: 5px; margin: 5px;
@ -62,11 +72,13 @@
} }
.footer button { .footer button {
pointer-events: auto;
margin: auto; margin: auto;
padding: 7px 10px 5px; padding: 7px 10px 5px;
} }
.footer svg { .footer svg {
pointer-events: none;
width: 25px; width: 25px;
height: 25px; height: 25px;
fill: royalblue; fill: royalblue;
@ -81,6 +93,12 @@
}, },
data: () => ({ data: () => ({
status: null status: null
}) }),
methods: {
alert: function (e) {
e.preventDefault()
window.alert(e.target)
}
}
} }
</script> </script>