diff --git a/plugins/poll/assets/javascripts/components/poll-option.js.es6 b/plugins/poll/assets/javascripts/components/poll-option.js.es6 index aec6e6c79ea..fdc10663143 100644 --- a/plugins/poll/assets/javascripts/components/poll-option.js.es6 +++ b/plugins/poll/assets/javascripts/components/poll-option.js.es6 @@ -12,7 +12,8 @@ export default Em.Component.extend({ var styles = []; if (this.get("color")) { styles.push("color:" + this.get("color")); } if (this.get("background")) { styles.push("background:" + this.get("background")); } - return styles.length > 0 ? styles.join(";") : false; + + return (styles.length > 0 ? styles.join(";") : '').htmlSafe(); }.property("color", "background"), render(buffer) { diff --git a/plugins/poll/assets/javascripts/components/poll-results-standard.js.es6 b/plugins/poll/assets/javascripts/components/poll-results-standard.js.es6 index 64abdf6680b..dd778026f7c 100644 --- a/plugins/poll/assets/javascripts/components/poll-results-standard.js.es6 +++ b/plugins/poll/assets/javascripts/components/poll-results-standard.js.es6 @@ -13,9 +13,9 @@ export default Em.Component.extend({ if (backgroundColor) { styles.push("background: " + backgroundColor); } option.setProperties({ - percentage: percentage, + percentage, title: I18n.t("poll.option_title", { count: option.get("votes") }), - style: styles.join(";") + style: styles.join(";").htmlSafe() }); }); diff --git a/plugins/poll/assets/javascripts/discourse/templates/components/poll-results-standard.hbs b/plugins/poll/assets/javascripts/discourse/templates/components/poll-results-standard.hbs index b17c1361e9f..4f29d18dac4 100644 --- a/plugins/poll/assets/javascripts/discourse/templates/components/poll-results-standard.hbs +++ b/plugins/poll/assets/javascripts/discourse/templates/components/poll-results-standard.hbs @@ -5,7 +5,7 @@ -
+
{{/each}} diff --git a/plugins/poll/assets/javascripts/initializers/extend-for-poll.js.es6 b/plugins/poll/assets/javascripts/initializers/extend-for-poll.js.es6 index c9c6beddd3d..2a85abd1c64 100644 --- a/plugins/poll/assets/javascripts/initializers/extend-for-poll.js.es6 +++ b/plugins/poll/assets/javascripts/initializers/extend-for-poll.js.es6 @@ -5,12 +5,7 @@ function createPollView(container, post, poll, vote) { view = container.lookup("view:poll"); controller.set("vote", vote); - - controller.setProperties({ - model: Em.Object.create(poll), - post: post, - }); - + controller.setProperties({ model: Em.Object.create(poll), post }); view.set("controller", controller); return view; @@ -53,7 +48,7 @@ export default { pollView = createPollView(container, post, polls[pollName], votes[pollName]); $poll.replaceWith($div); - pollView.constructor.renderer.replaceIn(pollView, $div[0]); + pollView.renderer.replaceIn(pollView, $div[0]); pollViews[pollName] = pollView; });