Created
January 16, 2014 12:51
-
-
Save p4ulypops/8454521 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button class="replybutton" data-origional="123" data-parent="123">Reply</button> | |
<script> | |
$('.replybutton').on('click', function(){ | |
$(this).addClass('loading'); // a class that adds a no-repeat right-aligned background of a spinning giff... give it some padding so it appears 'in the button'. | |
if ($(this).is(":visible")) { | |
$("#post" + $(this).data("parent")).slideUp(); | |
} else { | |
$("#post" + $(this).data("parent")).hide(); | |
$("#post" + $(this).data("parent")).load("/reply?parentPost=" + $(this).data("parent") + "&originalPost=" + $(this).data("origional"), function () { | |
$("#post" + $(this).data("parent")).slideDown(); | |
$(this).removeClass("loading"); | |
}); | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment