From ba80ca2ee598c503d8e31afe07627476c4fd4558 Mon Sep 17 00:00:00 2001 From: Austin Bergstrom Date: Sun, 10 Mar 2013 19:56:32 -0400 Subject: [PATCH] added observer to Discourse.PagedownEditor value to refresh previewer --- .../javascripts/discourse/views/pagedown_editor.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/views/pagedown_editor.js b/app/assets/javascripts/discourse/views/pagedown_editor.js index 4782cc91781..ca571be1254 100644 --- a/app/assets/javascripts/discourse/views/pagedown_editor.js +++ b/app/assets/javascripts/discourse/views/pagedown_editor.js @@ -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') });