mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-10-07 00:13:01 -04:00
43 lines
1.2 KiB
PHP
43 lines
1.2 KiB
PHP
<script>
|
|
(function ($) {
|
|
"use strict";
|
|
|
|
$('tbody').sortable({
|
|
cursor: "move",
|
|
update: function (event, ui) {
|
|
let ids = $(this).sortable('toArray', {attribute: 'data-item'});
|
|
if (ids.length > 0) {
|
|
let data = {
|
|
'_token': '{{ csrf_token() }}',
|
|
'ids': ids,
|
|
}
|
|
$.post("{{route('changePlanPosition')}}", data, function (data) {
|
|
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
$('#add_plan').on('click', function(ev) {
|
|
ev.preventDefault();
|
|
Subscription.PlanDialog.open({ title: 'Add Plan' });
|
|
});
|
|
|
|
$('.edit_plan').on('click', function(ev) {
|
|
ev.preventDefault();
|
|
|
|
var data = $(this).data('item');
|
|
|
|
Subscription.PlanDialog.open({ title: 'Edit Plan', data, mode: 'edit' });
|
|
});
|
|
|
|
$('.delete_plan').on('click', function(ev) {
|
|
ev.preventDefault();
|
|
|
|
var item = $(this).data('item');
|
|
|
|
Subscription.Plan.delete({ title: 'Confirmation', message: `Are you sure you want to delete this plan (${item.title})?`, item });
|
|
});
|
|
})(jQuery);
|
|
</script>
|