Skip to content

Commit

Permalink
Added ability to edit body of a tag.
Browse files Browse the repository at this point in the history
The implementation is a bit sloppy, and will likely need to be
revisted by the touchup fairy, but at least the raw functionality
is now accessible.
  • Loading branch information
lethain committed Jul 7, 2008
1 parent 14283b2 commit f69a957
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion templates/lifeflow/editor/comments.html
Expand Up @@ -7,6 +7,16 @@
var id = "#comment_" + pk;
$(id).fadeOut('slow');
}
var update_comment = function(pk) {
var data = { body:$("#"+pk).val() }
update_model("comment", pk, data);
}

$(document).ready(function() {
$("textarea").hover(function(){},function(){ update_comment(this.id); });
});


</script>

<div class="editing comments">
Expand All @@ -24,7 +34,11 @@
<li id="comment_{{ comment.pk }}">
<div class="data">
<p> {{ comment.name }} ({{ comment.email }}) at {{ comment.date }} on {{ comment.entry }}. </p>
<p>{{ comment.html|safe }}</p>
{% ifequal comment.body "" %}
<p class="html"> {{ comment.html|safe }} </p>
{% else %}
<textarea id="{{ comment.pk }}" class="body">{{ comment.body }} </textarea>
{% endifequal %}
</div>
<div class="controls">
<a class="button negative" onclick="delete_comment({{ comment.pk }})">delete</a>
Expand Down

0 comments on commit f69a957

Please sign in to comment.