fixing conflicts

This commit is contained in:
Sacha Greif 2012-09-21 17:50:03 +09:00
commit 527cebc6a9
2 changed files with 14 additions and 16 deletions

View file

@ -4,18 +4,18 @@
{{> post_item}}
{{/with}}
{{#if show_comment_form}}
{{#constant}}
<div class="comment-new">
<form>
<div class="comment-field" id="editor">
<div class="comment-new">
<form>
{{#constant}}
<div class="comment-field" id="editor">
<textarea id="comment" rows="3" autofocus="autofocus"></textarea>
</div>
<div class="comment-submit">
<input type="submit" class="button" value="Add Comment" />
</div>
</form>
</div>
{{/constant}}
<div class="comment-submit">
<input type="submit" class="button" value="Add Comment" />
</div>
{{/constant}}
</form>
</div>
{{/if}}
{{> comment_list}}
</div>

View file

@ -1,11 +1,9 @@
(function() {
var editor;
Template.post_page.events = {
'click input[type=submit]': function(e){
'click input[type=submit]': function(e, template){
e.preventDefault();
var content = editor.exportFile();
var content = template.editor.exportFile();
var post_id = Session.get('selected_post_id');
var $comment = $('#comment');
var new_comment_id=Meteor.call('comment', post_id, null, content, function(error, result){
@ -33,8 +31,8 @@ Template.post_page.body_formatted = function(){
Template.post_page.rendered = function(){
// t("post_page");
if(Meteor.user()){
editor= new EpicEditor(EpicEditorOptions).load();
if(Meteor.user() && !this.editor){
this.editor = new EpicEditor(EpicEditorOptions).load();
}
}