Skip to content

Commit

Permalink
Updated README, CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
asantibanez committed Mar 27, 2021
1 parent a9195f1 commit 442b83c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `laravel-blade-sortable` will be documented in this file

## 1.2.0 - 2020-03-26

- Added extra info to Livewire callbacks

## 1.1.0 - 2020-03-24

- Fixed drag/drop input value auto update
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ sorting event happens and will call the specified method/callback.

```blade
<x-laravel-blade-sortable::sortable
name="dropzone"
wire:onSortOrderChange="handleSortOrderChange"
>
{{-- Items here --}}
Expand All @@ -180,6 +181,19 @@ current order.

![livewire](https://github.com/asantibanez/laravel-blade-sortable/raw/master/examples/livewire.gif)

Extra info is passed along too, so you can check extra data when processing the sort order

```php
public function handleOnSortOrderChanged($sortOrder, $previousSortOrder, $name, $from, $to)
{
// $sortOrder = new keys order
// $previousSortOrder = keys previous order
// $name = drop target name
// $from = name of drop target from where the dragged/sorted item came from
// $to = name of drop target to where the dragged/sorted item was placed
}
```

### Customization

To support some advanced features of SortableJs, it is possible to pass the following
Expand Down

0 comments on commit 442b83c

Please sign in to comment.