Return the post element if its containing post element is requested.
[Sone.git] / src / main / resources / static / javascript / sone.js
index b8be6b3..4277d9a 100644 (file)
@@ -282,7 +282,7 @@ function generateSoneList(sones) {
        var soneList = "";
        $.each(sones, function() {
                if (soneList != "") {
-                       soneList += "\n";
+                       soneList += "";
                }
                soneList += this.name;
        });
@@ -301,7 +301,7 @@ function getSoneId(element) {
 }
 
 function getPostElement(element) {
-       return $(element).parents(".post");
+       return $(element).hasClass("post") ? $(element) : $(element).parents(".post");
 }
 
 function getPostId(element) {