mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
Upgrade to 1.8.1: So long, metamorphs!
This commit is contained in:
@ -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')
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user