VitProg / ember-cli-sortable

Ember CLI addon for RubaXa's sortable plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I forked this from MaazAli/ember-cli-sortable and made some changes because it cannot work well with ember. And I decided to publish this by myself since auther haven't updated his repository for very long time and do not answer any merge requests.

ember-cli-sortable

This is an ember-cli addon that integrates RubaXa's Sortable plugin with Ember. It is still rough around the edges but works pretty well and is currently being used in production.

Installation

npm install ember-cli-sortable --save

Usage

{{#sortable-items
  itemCollection=someArray
  animation=100
  handle=".item__handle"
  filter=".item--pinned"
  draggable=".item"
  ghostClass="item--ghost"
  onItemMoveAction="itemMoved"
  noItemText="<div style='text-align:center'>No items found</div>"
  as |item index|
}}
  <div>
    <div class="item__handle">{{item.name}}</div>
    <div class="item__sub">{{item.content}}</div>
  </div>
{{/sortable-items}}

####Supports all properties and callbacks from RubaXa's Sortable

####Properties

sort
disabled
store
animation
handle
filter
draggable
ghostClass
scroll
scrollSensitivity
scrollSpeed

####Callbacks

onStart
onAdd
onEnd
onUpdate
onSort
onRemove
onFilter

Add Action at the end of each callback to specify your own action handlers

Example

{{sortable-items
  onStartAction="myStartAction"
  onAddAction="myAddAction"
  ...
  ...
  ...
}}

Contribution

Fork this repository, make a feature branch and send in a pull request.

About

Ember CLI addon for RubaXa's sortable plugin

License:MIT License


Languages

Language:JavaScript 87.4%Language:HTML 12.6%