ianbale / ember-html5-draggable

HTML5 sortable / draggable lists
MIT License
2 stars 0 forks source link

Empty sortable group #1

Open mrosenberg opened 8 years ago

mrosenberg commented 8 years ago

If you don't prefill the sortable group array with at least one item, no drop zone is created. This prohibits adding any items to the sortable group array.

mrosenberg commented 8 years ago

I was able to get around the issue by checking for array length and using a dummy sortable item.

          {{#sortable-group
            tagName="div"
            model=modules
            onChange="update"
            onInsert="insert"
            onSortStart="sortstart"
            onSortEnd="sortend"
            as |group|
          }}

            {{#unless modules.length}}

              {{#sortable-item
                group=group
              }}

                <p>Drag here to start building your report.</p>

              {{/sortable-item}}

            {{else}}

              {{#each modules as |module|}}

.....