d9f34866 by Jeremy Groot

fix to favourites

1 parent f7173a50
......@@ -9428,6 +9428,13 @@ label[for=quicksearch] {
background-repeat: no-repeat;
background-position: right;
}
.favourite.loading {
background: url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><style>.spinner_ajPY{transform-origin:center;animation:spinner_AtaB .75s infinite linear}@keyframes spinner_AtaB{100%{transform:rotate(360deg)}}</style><path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"/><path d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z" class="spinner_ajPY"/></svg>');
background-repeat: no-repeat;
background-position: right;
background-size: contain;
}
.next.paginate_button,
.previous.paginate_button {
font-size: 0px;
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
......@@ -22975,20 +22975,23 @@
});
$('.favourite').on('click', function (e) {
e.preventDefault();
if ($(this).attr('disabled')) {
return;
}
$(this).attr('disabled', true).addClass('loading');
var _request = $(this).attr('href'),
_other_request = $(this).data('other-request');
var that = this;
if ($(this).hasClass('fav')) {
$(this).removeClass('fav');
} else {
$(this).addClass('fav');
}
$.get(_request, function (response) {
if (response.response === true) {
var _href = _request;
$(that).attr('href', _other_request);
$(that).data('other-request', _href);
if (response.response_body == 'rm') {
$(that).removeClass('fav');
} else {
$(that).addClass('fav');
}
}
}).done(function () {
$(that).attr('disabled', false).removeClass('loading');
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
......@@ -76,20 +76,23 @@ jQuery(document).ready(function($) {
$('.favourite').on('click', function(e) {
e.preventDefault();
if($(this).attr('disabled')) {
return;
}
$(this).attr('disabled', true).addClass('loading');
var _request = $(this).attr('href'),
_other_request = $(this).data('other-request');
var that = this;
if($(this).hasClass('fav')) {
$(this).removeClass('fav');
} else {
$(this).addClass('fav');
}
$.get(_request, function(response) {
if(response.response === true) {
var _href = _request;
$(that).attr('href',_other_request);
$(that).data('other-request', _href);
if(response.response_body == 'rm') {
$(that).removeClass('fav');
} else {
$(that).addClass('fav');
}
}
}).done(function() {
$(that).attr('disabled', false).removeClass('loading');
......
......@@ -268,11 +268,16 @@ label[for="quicksearch"] {
background-position: right;
display: flex;
&.fav {
background:url('data:image/svg+xml,<svg id="ICON_-_Heart" data-name="ICON - Heart" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20.847" height="19.166" viewBox="0 0 20.847 19.166"><defs><clipPath id="clip-path"><rect id="Rectangle_189" data-name="Rectangle 189" width="20.847" height="19.166" fill="%23eb519a" stroke="%23eb519a" stroke-width="1"/></clipPath></defs><g id="Group_1167" data-name="Group 1167" clip-path="url(%23clip-path)"><path id="Path_1371" data-name="Path 1371" d="M9.976,3.11c-.218-.229-.387-.41-.56-.589a4.869,4.869,0,0,0-7.187,6.57c2.344,2.622,4.735,5.2,7.112,7.794.467.508.8.508,1.259.006,2.377-2.593,4.765-5.174,7.112-7.794a4.869,4.869,0,0,0-7.174-6.583c-.173.18-.342.364-.561.6" transform="translate(0.45 0.45)" fill="%23eb519a" stroke="%23eb519a" stroke-width="1"/><path id="Path_1372" data-name="Path 1372" d="M9.976,3.11c.219-.232.389-.416.561-.6A4.869,4.869,0,0,1,17.711,9.1c-2.346,2.619-4.735,5.2-7.112,7.794-.46.5-.792.5-1.259-.006-2.377-2.593-4.768-5.172-7.112-7.794a4.869,4.869,0,0,1,7.187-6.57c.173.178.342.36.56.589" transform="translate(0.45 0.45)" fill="%23eb519a" stroke="%23eb519a" stroke-width="1"/><path id="Path_1373" data-name="Path 1373" d="M9.976,3.11c.219-.232.389-.416.561-.6A4.869,4.869,0,0,1,17.711,9.1c-2.346,2.619-4.735,5.2-7.112,7.794-.46.5-.792.5-1.259-.006-2.377-2.593-4.768-5.172-7.112-7.794a4.869,4.869,0,0,1,7.187-6.57C9.589,2.7,9.758,2.881,9.976,3.11Z" transform="translate(0.45 0.45)" fill="%23eb519a" stroke="%23eb519a" stroke-width="2"/></g></svg>');
background-repeat: no-repeat;
background-position: right;
}
&.loading {
background:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><style>.spinner_ajPY{transform-origin:center;animation:spinner_AtaB .75s infinite linear}@keyframes spinner_AtaB{100%{transform:rotate(360deg)}}</style><path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"/><path d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z" class="spinner_ajPY"/></svg>');
background-repeat: no-repeat;
background-position: right;
background-size: contain;
}
}
......