Fallback to using the first list if [poll] isn't present.

This commit is contained in:
Vikhyat Korrapati
2014-02-20 13:46:27 +05:30
parent ac8203b601
commit 33cb4bc5ac
3 changed files with 18 additions and 4 deletions

View File

@ -97,7 +97,13 @@ Discourse.PostView.reopen({
}
var view = initializePollView(this);
view.replaceElement($post.find(".poll-ui:first"));
var pollContainer = $post.find(".poll-ui:first");
if (pollContainer.length == 0) {
pollContainer = $post.find("ul:first");
}
view.replaceElement(pollContainer);
this.set('pollView', view);
}.on('postViewInserted'),