Remove expand comments from the window namespace
This commit is contained in:
parent
a520c756ea
commit
faf5baf4c5
1 changed files with 10 additions and 22 deletions
|
|
@ -11,7 +11,15 @@ $(document).ready(function(){
|
||||||
// comment toggle action
|
// comment toggle action
|
||||||
$stream.not(".show").delegate("a.show_post_comments", "click", function(evt) {
|
$stream.not(".show").delegate("a.show_post_comments", "click", function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
expandComments($(this));
|
var $this = $(this),
|
||||||
|
text = $this.html();
|
||||||
|
commentBlock = $this.closest("li").find("ul.comments", ".content"),
|
||||||
|
show = (text.indexOf("show") != -1);
|
||||||
|
|
||||||
|
commentBlock.fadeToggle(150, function(){
|
||||||
|
commentBlock.toggleClass("hidden");
|
||||||
|
});
|
||||||
|
$this.html(text.replace((show) ? "show" : "hide", (show) ? "hide" : "show")$
|
||||||
});
|
});
|
||||||
|
|
||||||
// comment submit action
|
// comment submit action
|
||||||
|
|
@ -101,24 +109,4 @@ $(document).ready(function(){
|
||||||
alert('failed to post message!');
|
alert('failed to post message!');
|
||||||
});
|
});
|
||||||
|
|
||||||
});//end document ready
|
});
|
||||||
|
|
||||||
|
|
||||||
function expandComments(toggler,animate){
|
|
||||||
var text = toggler.html();
|
|
||||||
commentBlock = toggler.closest("li").find("ul.comments", ".content");
|
|
||||||
|
|
||||||
if(commentBlock.hasClass("hidden")) {
|
|
||||||
commentBlock.fadeIn(150, function(){
|
|
||||||
commentBlock.removeClass("hidden");
|
|
||||||
});
|
|
||||||
toggler.html(text.replace("show", "hide"));
|
|
||||||
|
|
||||||
} else {
|
|
||||||
commentBlock.fadeOut(100, function(){
|
|
||||||
commentBlock.addClass("hidden");
|
|
||||||
});
|
|
||||||
toggler.html(text.replace("hide", "show"));
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue