From fc25da09e3f502cb18969ecf425a3617063829b8 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 30 Jul 2013 11:20:11 -0400 Subject: [PATCH] Revert "Remove RawDivView and use regular handlebars" This reverts commit e7f349ff0f060a114bb456fe7dae1cdb5dbc1833. --- .../discourse/templates/post.js.handlebars | 2 +- .../javascripts/discourse/views/raw_div_view.js | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 app/assets/javascripts/discourse/views/raw_div_view.js diff --git a/app/assets/javascripts/discourse/templates/post.js.handlebars b/app/assets/javascripts/discourse/templates/post.js.handlebars index 3c3cbab395a..cd719a2f3d9 100644 --- a/app/assets/javascripts/discourse/templates/post.js.handlebars +++ b/app/assets/javascripts/discourse/templates/post.js.handlebars @@ -47,7 +47,7 @@ {{/unless}} -
{{{cooked}}}
+ {{view Discourse.RawDivView class="cooked" contentBinding="cooked"}} {{view Discourse.PostMenuView postBinding="this" postViewBinding="view"}} {{view Discourse.RepliesView contentBinding="replies" postViewBinding="view"}} diff --git a/app/assets/javascripts/discourse/views/raw_div_view.js b/app/assets/javascripts/discourse/views/raw_div_view.js new file mode 100644 index 00000000000..28ef39e8ff7 --- /dev/null +++ b/app/assets/javascripts/discourse/views/raw_div_view.js @@ -0,0 +1,11 @@ +// used to render a div with unescaped contents + +Discourse.RawDivView = Ember.View.extend({ + + shouldRerender: Discourse.View.renderIfChanged('content'), + + render: function(buffer) { + buffer.push(this.get('content')); + } + +});