Skip to content

Instantly share code, notes, and snippets.

@lvegerano
Created March 11, 2020 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lvegerano/9294d915f37712bfbf4680d90d401442 to your computer and use it in GitHub Desktop.
Save lvegerano/9294d915f37712bfbf4680d90d401442 to your computer and use it in GitHub Desktop.
Ember SortableJS examples
<SortableJs
class="list-group"
@items={{array "one-a" "two-a" "three-a" "four-a" "five-a"}}
@options={{hash
animation=150
ghostClass="ghost-class"
group=(hash name="shared" pull="clone")
}}
@onClone={{fn this.onClone}}
as |list|
>
{{log 'running a' list}}
{{#each list as |item index| }}
<div data-list-item={{index}} class="list-group-item">{{item.item}}</div>
{{/each}}
</SortableJs>
<br>
<SortableJs
class="list-group"
@items={{array "one-b" "two-b" "three-b" "four-b" "five-b"}}
@options={{hash
animation=150
ghostClass="ghost-class"
group=(hash name="shared" pull="clone")
}}
@onClone={{fn this.onClone}}
as |list|
>
{{log 'running b' list}}
{{#each list as |item index| }}
<div data-list-item={{index}} class="list-group-item">{{item.item}}</div>
{{/each}}
</SortableJs>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment