This commit is contained in:
Jay Trees 2022-02-24 10:00:53 +01:00
parent 6f44e8032f
commit d33fb99277
2 changed files with 44 additions and 44 deletions

View file

@ -100,50 +100,6 @@ $(function() {
filterRemoteData: true filterRemoteData: true
}); });
/**
* Commit to Product
*/
$(document).on('click', '.ui.button.commit', function() {
var button = $(this);
var card = button.closest('.ui.card');
var column = card.closest('.column');
$('body')
.modal({
title: 'Really commit?',
content: 'Would you really like to commit to this purchase? It will no longer appear in the wishlist anymore.',
class: 'tiny',
actions: [
{
text: 'Yes, commit',
class: 'approve primary'
},
{
text: 'Cancel',
class: ''
}
],
onApprove: function() {
/**
* Update product status
*/
button.api({
action: 'update product status',
method: 'PUT',
data: {
productID: card.data('id'),
productStatus: 'unavailable'
},
on: 'now',
onSuccess: function(response, element, xhr) {
column.fadeOut();
},
});
}
})
.modal('show');
});
/** /**
* Delete Product * Delete Product
*/ */

View file

@ -29,4 +29,48 @@ $(function() {
}) })
.modal('show'); .modal('show');
} }
/**
* Commit to Product
*/
$(document).on('click', '.ui.button.commit', function() {
var button = $(this);
var card = button.closest('.ui.card');
var column = card.closest('.column');
$('body')
.modal({
title: 'Really commit?',
content: 'Would you really like to commit to this purchase? It will no longer appear in the wishlist anymore.',
class: 'tiny',
actions: [
{
text: 'Yes, commit',
class: 'approve primary'
},
{
text: 'Cancel',
class: ''
}
],
onApprove: function() {
/**
* Update product status
*/
button.api({
action: 'update product status',
method: 'PUT',
data: {
productID: card.data('id'),
productStatus: 'unavailable'
},
on: 'now',
onSuccess: function(response, element, xhr) {
column.fadeOut();
},
});
}
})
.modal('show');
});
}); });