fix some svelte data warnings (#247)

This commit is contained in:
Nolan Lawson 2018-04-30 09:57:49 -07:00 committed by GitHub
parent f9792ae3d8
commit dbba271f39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 50 additions and 18 deletions

View file

@ -1,7 +1,7 @@
<a rel="nofollow noopener" <a rel="nofollow noopener"
target="_blank" target="_blank"
:href :href
aria-label={{ariaLabel || ''}} aria-label={{ariaLabel}}
class="{{className || ''}} {{showIcon ? 'external-link-with-icon' : ''}} {{normalIconColor ? 'normal-icon-color' : ''}}"> class="{{className || ''}} {{showIcon ? 'external-link-with-icon' : ''}} {{normalIconColor ? 'normal-icon-color' : ''}}">
<slot></slot>{{#if showIcon}} <slot></slot>{{#if showIcon}}
<svg class="external-link-svg"> <svg class="external-link-svg">
@ -26,7 +26,10 @@
<script> <script>
export default { export default {
data: () => ({ data: () => ({
normalIconColor: false className: void 0,
normalIconColor: false,
ariaLabel: '',
showIcon: false
}) })
} }
</script> </script>

View file

@ -24,3 +24,10 @@
background: var(--mask-opaque-bg); background: var(--mask-opaque-bg);
} }
</style> </style>
<script>
export default {
data: () => ({
className: void 0
})
}
</script>

View file

@ -69,6 +69,9 @@
export default { export default {
store: () => store, store: () => store,
data: () => ({
pinnable: false
}),
components: { components: {
IconButton IconButton
}, },

View file

@ -141,7 +141,10 @@
}, },
data: () => ({ data: () => ({
// don't animate if we're showing a modal dialog on top of another modal dialog. it looks ugly // don't animate if we're showing a modal dialog on top of another modal dialog. it looks ugly
shouldAnimate: !process.browser || document.getElementsByClassName('modal-dialog').length < 2 shouldAnimate: !process.browser || document.getElementsByClassName('modal-dialog').length < 2,
fadedIn: false,
muted: false,
className: void 0
}), }),
computed: { computed: {
backdropClass: (fadedIn, shouldAnimate) => { backdropClass: (fadedIn, shouldAnimate) => {

View file

@ -53,6 +53,9 @@
} }
}, },
store: () => store, store: () => store,
data: () => ({
overrideFollowing: void 0
}),
computed: { computed: {
accountId: (account) => account.id, accountId: (account) => account.id,
following: (relationship, overrideFollowing) => { following: (relationship, overrideFollowing) => {

View file

@ -73,11 +73,9 @@
import IconButton from '../IconButton.html' import IconButton from '../IconButton.html'
export default { export default {
components: { data: () => ({
Avatar, actions: void 0
SearchResult, }),
IconButton
},
methods: { methods: {
onButtonClick (event, action, accountId) { onButtonClick (event, action, accountId) {
event.preventDefault() event.preventDefault()
@ -87,6 +85,11 @@
accountId accountId
}) })
} }
},
components: {
Avatar,
SearchResult,
IconButton
} }
} }
</script> </script>

View file

@ -26,3 +26,10 @@
} }
} }
</style> </style>
<script>
export default {
data: () => ({
label: void 0
})
}
</script>

View file

@ -5,15 +5,9 @@
<use xlink:href={{icon}} /> <use xlink:href={{icon}} />
</svg> </svg>
{{/if}} {{/if}}
{{#if ariaLabel}} <span aria-label={{ariaLabel || label}} class={{offsetForIcon ? 'offset-for-icon' : ''}}>
<span aria-label={{ariaLabel}} class={{offsetForIcon ? 'offset-for-icon' : ''}}>
{{label}} {{label}}
</span> </span>
{{else}}
<span class={{offsetForIcon ? 'offset-for-icon' : ''}}>
{{label}}
</span>
{{/if}}
</a> </a>
</li> </li>
<style> <style>
@ -68,3 +62,12 @@
} }
</style> </style>
<script>
export default {
data: () => ({
icon: void 0,
ariaLabel: void 0,
offsetForIcon: void 0
})
}
</script>