parent
e9e6d3444d
commit
27c57b62d3
@ -1,21 +0,0 @@ |
||||
import $ from 'jquery' |
||||
|
||||
const swapItems = (element, event) => { |
||||
const $element = $(element) |
||||
const item = $element.parent().closest('[swappable-item]') |
||||
const next = item.nextAll('[swappable-item]:first') |
||||
|
||||
item.hide() |
||||
|
||||
if (next.length) { |
||||
next.show() |
||||
} else { |
||||
item.parent().find('[swappable-item]:first').show() |
||||
} |
||||
|
||||
return false |
||||
} |
||||
|
||||
$('[swappable-item] [swapper]').on('click', function (event) { |
||||
swapItems(this, event) |
||||
}) |
Loading…
Reference in new issue