use svelte shorthand wherever possible (#242)

This commit is contained in:
Nolan Lawson 2018-04-29 18:42:03 -07:00 committed by GitHub
parent c4182c9ddc
commit 8229d1c9e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 11 deletions

View File

@ -1,6 +1,6 @@
<a rel="nofollow noopener" <a rel="nofollow noopener"
target="_blank" target="_blank"
href={{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}}

View File

@ -3,7 +3,7 @@
aria-hidden={{ariaHidden}} aria-hidden={{ariaHidden}}
alt={{alt || ''}} alt={{alt || ''}}
title={{alt || ''}} title={{alt || ''}}
src={{src}} :src
on:imgLoad on:imgLoad
on:imgLoadError /> on:imgLoadError />
{{else}} {{else}}

View File

@ -15,9 +15,9 @@
/> />
{{else}} {{else}}
<img <img
src={{src}} :src
width={{width}} :width
height={{height}} :height
alt={{description || ''}} alt={{description || ''}}
title={{description || ''}} title={{description || ''}}
/> />

View File

@ -1,12 +1,12 @@
<div class="pseudo-virtual-list" on:initialized ref:node> <div class="pseudo-virtual-list" on:initialized ref:node>
{{#each wrappedItems as wrappedItem, i @item}} {{#each wrappedItems as wrappedItem, i @item}}
<PseudoVirtualListLazyItem <PseudoVirtualListLazyItem
component={{component}} :component
index={{i}} index={{i}}
length={{wrappedItems.length}} length={{wrappedItems.length}}
makeProps={{makeProps}} :makeProps
key={{wrappedItem.item}} key={{wrappedItem.item}}
intersectionObserver={{intersectionObserver}} :intersectionObserver
isIntersecting={{isIntersecting(wrappedItem.item, $intersectionStates)}} isIntersecting={{isIntersecting(wrappedItem.item, $intersectionStates)}}
isCached={{isCached(wrappedItem.item, $intersectionStates)}} isCached={{isCached(wrappedItem.item, $intersectionStates)}}
height={{getHeight(wrappedItem.item, $intersectionStates)}} height={{getHeight(wrappedItem.item, $intersectionStates)}}

View File

@ -1,5 +1,5 @@
<li class="search-result"> <li class="search-result">
<a href={{href}} class="search-result-anchor"> <a :href class="search-result-anchor">
<slot></slot> <slot></slot>
</a> </a>
</li> </li>

View File

@ -1,7 +1,7 @@
<SearchResult href="/statuses/{{status.id}}"> <SearchResult href="/statuses/{{status.id}}">
<Status :index :length <Status :index :length
timelineType="search" timelineValue="search" timelineType="search" timelineValue="search"
status={{status}} /> :status />
</SearchResult> </SearchResult>
<style> <style>
</style> </style>

View File

@ -7,7 +7,7 @@
{{#each $visibleItems as visibleItem @key}} {{#each $visibleItems as visibleItem @key}}
<VirtualListLazyItem :component <VirtualListLazyItem :component
offset={{visibleItem.offset}} offset={{visibleItem.offset}}
makeProps={{makeProps}} :makeProps
key={{visibleItem.key}} key={{visibleItem.key}}
index={{visibleItem.index}} index={{visibleItem.index}}
/> />