mirror of
https://github.com/neocities/neocities.git
synced 2025-06-28 23:23:22 +02:00
Almost where I want the follow button to be, but not quite
This commit is contained in:
parent
8665e70be1
commit
5011d83436
4 changed files with 42 additions and 19 deletions
|
@ -1,14 +1,11 @@
|
|||
var Site = {
|
||||
toggleFollow: function(siteId, csrfToken) {
|
||||
var link = $('a#followLink')
|
||||
var span = $('a#followLink span')
|
||||
$.post('/site/'+siteId+'/toggle_follow', {csrf_token: csrfToken}, function(res) {
|
||||
if(res.result == "followed") {
|
||||
span.text('Unfollow')
|
||||
link.removeClass('follow')
|
||||
link.addClass('is-following')
|
||||
} else if(res.result == 'unfollowed') {
|
||||
span.text('Follow')
|
||||
link.addClass('follow')
|
||||
link.removeClass('is-following')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue