Skip to content

Commit

Permalink
added observer to Discourse.PagedownEditor value to refresh previewer
Browse files Browse the repository at this point in the history
  • Loading branch information
Austin Bergstrom authored and Austin Bergstrom committed Mar 10, 2013
1 parent 45c4382 commit ba80ca2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/assets/javascripts/discourse/views/pagedown_editor.js
Expand Up @@ -34,7 +34,14 @@ Discourse.PagedownEditor = Ember.ContainerView.extend({
$wmdInput.data('init', true);
this.editor = Discourse.Markdown.createEditor();
return this.editor.run();
}
},

observeValue: (function() {
var _this = this;
Ember.run.next(null, function() {
_this.editor && _this.editor.refreshPreview();
});
}).observes('value')

});

Expand Down

0 comments on commit ba80ca2

Please sign in to comment.