Ajaxify bookmark buttons.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 17 Feb 2011 10:26:10 +0000 (11:26 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 17 Feb 2011 10:26:10 +0000 (11:26 +0100)
src/main/resources/static/javascript/sone.js

index c5296ca..e99d654 100644 (file)
@@ -692,6 +692,16 @@ function ajaxifyPost(postElement) {
                return false;
        });
 
+       /* convert bookmark/unbookmark buttons to javascript functions. */
+       $(postElement).find(".bookmark").submit(function() {
+               bookmarkPost(getPostId(this));
+               return false;
+       });
+       $(postElement).find(".unbookmark").submit(function() {
+               unbookmarkPost(getPostId(this));
+               return false;
+       });
+
        /* add “comment” link. */
        addCommentLink(getPostId(postElement), postElement, $(postElement).find(".post-status-line .time"));