1
0
Fork 0

Splattribute refactorings

This commit is contained in:
Ava Wroten 2020-03-09 18:53:56 -05:00
parent 2730cefd86
commit 8a047250ff
3 changed files with 35 additions and 31 deletions

View file

@ -1,5 +1,8 @@
<SortableGroupAccessible
{{#if this.sortedItems}}
<SortableGroupAccessible
@models={{this.sortedItems}}
tabindex="0"
class="shadow-md bg-gray-200 outline-none border border-gray-400 focus:border-teal-400 focus:shadow-lg"
as |groupHasFocus selectedIndex groupActions|>
<SortableGroup
@onChange={{action this.reorderMeals}}
@ -11,7 +14,8 @@
@selectedIndex={{selectedIndex}}
@orderItemDown={{groupActions.orderItemDown}}
@orderItemUp={{groupActions.orderItemUp}}
@handleBlur={{groupActions.handleBlur}}>
@handleBlur={{groupActions.handleBlur}}
class="shadow-md bg-gray-200 outline-none border border-gray-400 focus:border-teal-400 focus:shadow-lg">
<SortableItem
@model={{meal}}
@group={{group}}
@ -25,4 +29,5 @@
</SortableItemAccessible>
{{/each}}
</SortableGroup>
</SortableGroupAccessible>
</SortableGroupAccessible>
{{/if}}

View file

@ -6,8 +6,7 @@
{{key-up this.handleArrowDown key='ArrowDown'}}
{{key-down this.preventDefault key='ArrowUp'}}
{{key-down this.preventDefault key='ArrowDown'}}
tabindex="0"
class="shadow-md bg-gray-200 outline-none border border-gray-400 focus:border-teal-400 focus:shadow-lg">
...attributes>
{{yield
this.groupHasFocus
this.selectedIndex

View file

@ -1,5 +1,5 @@
{{#let (and @groupHasFocus (eq @currentIndex @selectedIndex)) as |active|}}
<div class='border border-gray-400 {{if active 'relative border-orange-400'}}'>
<div class='border border-gray-400 {{if active 'relative border-orange-400'}}' ...attributes>
{{#if active}}
<button
{{on 'click' (fn @orderItemUp @currentIndex)}}