9f5402f896
* Now is more DRY, the JS code and the HTML code are in one place * It works even without JS Signed-off-by: volpino <fox91@anche.no>
24 lines
642 B
JavaScript
24 lines
642 B
JavaScript
$(document).ready(function() {
|
|
$(".favourite-form").submit(function(e) {
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
|
|
$.post($(this).attr("action"), {packages: window.packages}, function() {
|
|
$(".unfavourite-button").removeClass("hide");
|
|
$(".favourite-button").addClass("hide");
|
|
});
|
|
return false;
|
|
});
|
|
|
|
$(".unfavourite-form").submit(function(e) {
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
|
|
$.post($(this).attr("action"), {packages: window.packages}, function() {
|
|
$(".favourite-button").removeClass("hide");
|
|
$(".unfavourite-button").addClass("hide");
|
|
});
|
|
return false;
|
|
});
|
|
});
|