Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).on('click', '.move-to__item', function() {
- var $this = $(this),
- $list = $this.parent('ul'),
- $order = $this.parents('.advertisement'),
- data = $.extend($this.data(), $order.data()),
- url = '/move2/';
- $list.hide();
- mscConfirm("Вы подтверждаете действие?", "", function () {
- $.ajax({
- url: url,
- data: data,
- method: 'POST',
- success: function() {
- $list.empty();
- $.each(statuses, function(statusId, statusText) {
- if (+statusId !== data.status) {
- $list.append($('<li data-status="' + statusId + '" data-id="' + data.id + '" class="move-to__item"> \
- <a href="#">' + statusText + '</a> \
- </li>'));
- }
- });
- $('.advertisement-list')
- .eq(data.status - 1)
- .find('> ul')
- .eq(+($order.data('type') !== 'order'))
- .append($order);
- },
- error: function(d) {
- console.log(d);
- }
- });
- });
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement