mirror of
https://github.com/discourse/discourse.git
synced 2025-06-18 06:22:40 +08:00
firefox / concurrency fix, would not navigate correctly to a post.
posts can be in the DOM in a non-ready state between willInsertElement and didInsertElement didInsertElement takes care of the scrolling, ignore analysing anything about that post until its properly inserted
This commit is contained in:
@ -243,6 +243,7 @@ Discourse.PostView = Discourse.View.extend({
|
|||||||
// Find all the quotes
|
// Find all the quotes
|
||||||
this.insertQuoteControls();
|
this.insertQuoteControls();
|
||||||
|
|
||||||
|
$post.addClass('ready');
|
||||||
// be sure that eyeline tracked it
|
// be sure that eyeline tracked it
|
||||||
var controller = this.get('controller');
|
var controller = this.get('controller');
|
||||||
if (controller && controller.postRendered) {
|
if (controller && controller.postRendered) {
|
||||||
|
@ -397,7 +397,7 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
|
|||||||
|
|
||||||
updatePosition: function(userActive) {
|
updatePosition: function(userActive) {
|
||||||
|
|
||||||
var rows = $('.topic-post');
|
var rows = $('.topic-post.ready');
|
||||||
if (!rows || rows.length === 0) { return; }
|
if (!rows || rows.length === 0) { return; }
|
||||||
|
|
||||||
// if we have no rows
|
// if we have no rows
|
||||||
@ -486,7 +486,8 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
|
|||||||
latestLink: "<a href=\"/\">" + (Em.String.i18n("topic.view_latest_topics")) + "</a>"
|
latestLink: "<a href=\"/\">" + (Em.String.i18n("topic.view_latest_topics")) + "</a>"
|
||||||
};
|
};
|
||||||
|
|
||||||
if (category = this.get('controller.content.category')) {
|
category = this.get('controller.content.category');
|
||||||
|
if (category) {
|
||||||
opts.catLink = Discourse.Utilities.categoryLink(category);
|
opts.catLink = Discourse.Utilities.categoryLink(category);
|
||||||
} else {
|
} else {
|
||||||
opts.catLink = "<a href=\"" + Discourse.getURL("/categories") + "\">" + (Em.String.i18n("topic.browse_all_categories")) + "</a>";
|
opts.catLink = "<a href=\"" + Discourse.getURL("/categories") + "\">" + (Em.String.i18n("topic.browse_all_categories")) + "</a>";
|
||||||
|
Reference in New Issue
Block a user