mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
Finished up follow button
This commit is contained in:
parent
f2e57193dd
commit
600eefeecf
2 changed files with 12 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
||||||
|
var link = $('a#followLink');
|
||||||
|
|
||||||
var Site = {
|
var Site = {
|
||||||
toggleFollow: function(siteId, csrfToken) {
|
toggleFollow: function(siteId, csrfToken) {
|
||||||
var link = $('a#followLink')
|
|
||||||
$.post('/site/'+siteId+'/toggle_follow', {csrf_token: csrfToken}, function(res) {
|
$.post('/site/'+siteId+'/toggle_follow', {csrf_token: csrfToken}, function(res) {
|
||||||
if(res.result == "followed") {
|
if(res.result == "followed") {
|
||||||
link.addClass('is-following')
|
link.addClass('is-following')
|
||||||
|
@ -9,4 +10,12 @@ var Site = {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
|
$('a#followLink').hover(function() {
|
||||||
|
if (link.hasClass('is-following')) {
|
||||||
|
$('a#followLink').addClass('unfollow');
|
||||||
|
}
|
||||||
|
}, function() {
|
||||||
|
$('a#followLink').removeClass('unfollow');
|
||||||
|
});
|
|
@ -693,7 +693,7 @@ a.tag:hover {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#followLink.is-following:hover {
|
#followLink.is-following.unfollow {
|
||||||
.follow {
|
.follow {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue