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

View file

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

View file

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

View file

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