1
0
mirror of https://github.com/flarum/core.git synced 2025-07-29 04:30:56 +02:00

Use component prototypes instead of instances

This means the component instance is created in the template, meaning
properties can be overridden in the view helper. It also just makes
more sense - a view instance doesn’t need to exist until it is rendered
in the template.
This commit is contained in:
Toby Zerner
2015-02-26 09:43:53 +10:30
parent 12c4b60730
commit 8683025ef6
14 changed files with 43 additions and 33 deletions

View File

@@ -12,7 +12,7 @@ export default ComposerBody.extend({
submitLabel: 'Post Reply',
populateControls: function(items) {
var title = Ember.Component.create({
var title = Ember.Component.extend({
tagName: 'h3',
layout: precompileTemplate('Replying to <em>{{component.discussion.title}}</em>'),
component: this