Upgrade to 1.8.1: So long, metamorphs!

This commit is contained in:
Robin Ward
2014-12-01 12:54:59 -05:00
parent b4363de280
commit 39fde5b9fb
15 changed files with 13494 additions and 10660 deletions

View File

@ -49,12 +49,6 @@ var Poll = Discourse.Model.extend({
var PollView = Ember.View.extend({
templateName: "poll",
classNames: ['poll-ui'],
replaceElement: function(target) {
this._insertElementLater(function() {
target.replaceWith(this.$());
});
}
});
function initializePollView(self) {
@ -70,13 +64,9 @@ function initializePollView(self) {
postController: self.get('controller')
});
var pollView = self.createChildView(PollView, {
controller: pollController
});
return pollView;
return self.createChildView(PollView, { controller: pollController });
}
export default {
name: 'poll',
@ -90,13 +80,14 @@ export default {
}
var view = initializePollView(this);
var pollContainer = $post.find(".poll-ui:first");
if (pollContainer.length === 0) {
pollContainer = $post.find("ul:first");
}
view.replaceElement(pollContainer);
var $div = $('<div>');
pollContainer.replaceWith($div);
view.constructor.renderer.appendTo(view, $div[0]);
this.set('pollView', view);
}.on('postViewInserted'),
@ -108,4 +99,4 @@ export default {
}.on('willClearRender')
});
}
}
};