Closed jorjordandan closed 9 years ago
added the ability to pass "both" to the [data-ion-list-toggle] in a button, which will show the hidden buttons on both sides of the list, so that you can sort and delete at the same time.
Demo repo at http://reorderable_contacts.meteor.com/
Looks great @jorjordandan! Would you be able to update the README and check off these components? Also if you have time, it'd be great to add this to the demo.
Absolutely, thanks! I'll do both asap.
So here's where this is at:
This PR adds a component
ionListButton
which is used inside a list item like this:You can use these hide-able buttons for anything, for instance, if you wanted to use them for a share button, you could add
action="share"
and then create a event on theitem-share
class that's generated. They are pretty much decoupled from the sortable/deletable stuff.The sortable/deleteable functionality requires that you pass the collection as an argument into ionList, for example
{{#ionList ionSortable=collection}}
In an updated contacts example app collection is a helper method that simply returns the Contacts collection:In addition to passing the collection into the sort and delete events, the
ionSortable
argument also sets a Session variable flag that is used to prevent unwanted behaviour, most importantly preventing a new Slip.js object from being initialized if unneeded.