This commit is contained in:
Jay Trees 2022-03-11 15:56:42 +01:00
parent d4737921aa
commit 6ccd38cc9b
4 changed files with 77 additions and 77 deletions

View file

@ -55,17 +55,17 @@ $(function() {
$('body')
.modal({
title: 'Failure',
content: response,
class: '',
actions: [
title : 'Failure',
content : response,
class : '',
actions : [
{
text: 'Thanks for nothing',
class: 'primary'
}
]
})
.modal('show');
],
autoShow: true
});
}
$.fn.api.settings.onError = function(response, element, xhr) {
if ('string' === typeof response) {
@ -74,17 +74,17 @@ $(function() {
$('body')
.modal({
title: 'Error',
content: response,
class: '',
actions: [
title : 'Error',
content : response,
class : '',
actions : [
{
text: 'Thanks for nothing',
class: 'primary'
}
]
})
.modal('show');
],
autoShow: true
});
}
/** */
@ -147,15 +147,15 @@ function showError(error) {
$('body')
.modal({
title: 'Error',
content: error,
class: '',
actions: [
title : 'Error',
content : error,
class : '',
actions : [
{
text: 'Thanks for nothing',
class: 'primary'
}
]
})
.modal('show');
],
autoShow: true
});
}

View file

@ -21,7 +21,8 @@ $(function () {
modalAutoFill
.modal({
onApprove: function(buttonApprove) {
autoShow : true,
onApprove: function() {
formWish.addClass('loading');
fetch('/src/api/wishes.php?wish_url=' + inputURL.val(), {
@ -74,6 +75,7 @@ $(function () {
elementModalFetch
.modal({
autoShow: true,
onApprove: function (buttonFetch) {
var formData = new URLSearchParams();
formData.append('wish_url_current', inputURL.val());
@ -103,8 +105,7 @@ $(function () {
onHide: function() {
formWish.removeClass('loading');
}
})
.modal('show');
});
} else {
$('body').toast({
class: 'primary',
@ -116,8 +117,7 @@ $(function () {
})
.catch(handleFetchCatch);
}
})
.modal('show');
});
});
@ -129,6 +129,7 @@ $(function () {
modalImage
.modal({
autoShow: true,
onApprove: function() {
var newImageURL = modalImage.find('[name="wish_image"]').val();
@ -140,8 +141,7 @@ $(function () {
message: 'Don\'t forget to save your changes.'
});
}
})
.modal('show');
});
});
/**

View file

@ -22,14 +22,14 @@ $(function() {
class: 'deny'
}
],
autoShow: true,
onApprove: function() {
window.close();
},
onDeny: function() {
$('.wishlist-own').slideUp();
}
})
.modal('show');
});
}
/**
@ -55,6 +55,7 @@ $(function() {
class: ''
}
],
autoShow : true,
onApprove: function() {
/**
* Update wish status
@ -72,7 +73,6 @@ $(function() {
},
});
}
})
.modal('show');
});
});
});
});

View file

@ -182,6 +182,7 @@ $(function () {
modalRename
.modal({
autoShow: true,
onApprove: function(buttonApprove) {
buttonApprove.addClass('loading disabled');
@ -207,8 +208,7 @@ $(function () {
return false;
}
})
.modal('show');
});
});
/**
@ -235,6 +235,7 @@ $(function () {
class: 'deny'
},
],
autoShow : true,
onApprove: function (buttonApprove) {
buttonApprove.addClass('loading');
@ -268,8 +269,7 @@ $(function () {
*/
return false;
}
})
.modal('show');
});
}
});
@ -296,6 +296,7 @@ $(function () {
text: 'Cancel'
}
],
autoShow: true,
onApprove: function (buttonApprove) {
buttonApprove.addClass('loading');
@ -328,8 +329,7 @@ $(function () {
*/
return false;
}
})
.modal('show');
});
});
/**
@ -341,6 +341,7 @@ $(function () {
modalWishlistWishAdd.find('[name="wishlist_id"]').val($('.ui.dropdown.wishlists').dropdown('get value'));
modalWishlistWishAdd
.modal({
autoShow : true,
onApprove: function (buttonAdd) {
buttonAdd.addClass('loading');
@ -368,8 +369,7 @@ $(function () {
return false;
}
})
.modal('show');
});
});
/**
@ -381,6 +381,7 @@ $(function () {
modalWishlistCreate
.modal({
autoShow: true,
onApprove: function (buttonCreate) {
const formData = new URLSearchParams(new FormData(formWishlistCreate[0]));
@ -410,8 +411,7 @@ $(function () {
return false;
}
})
.modal('show');
});
});
});