FIX: On long browsers, you could get a double title
This commit is contained in:
parent
2418daeb63
commit
62be121328
|
@ -37,7 +37,7 @@ export default Ember.Component.extend(AddArchetypeClass, Scrolling, {
|
||||||
const enteredAt = this.get('enteredAt');
|
const enteredAt = this.get('enteredAt');
|
||||||
if (enteredAt && (this.get('lastEnteredAt') !== enteredAt)) {
|
if (enteredAt && (this.get('lastEnteredAt') !== enteredAt)) {
|
||||||
this._lastShowTopic = null;
|
this._lastShowTopic = null;
|
||||||
this.scrolled();
|
Ember.run.schedule('afterRender', () => this.scrolled());
|
||||||
this.set('lastEnteredAt', enteredAt);
|
this.set('lastEnteredAt', enteredAt);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -131,20 +131,21 @@ export default Ember.Component.extend(AddArchetypeClass, Scrolling, {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.set('hasScrolled', offset > 0);
|
this.set('hasScrolled', offset > 0);
|
||||||
|
|
||||||
const topic = this.get('topic');
|
const topic = this.get('topic');
|
||||||
const showTopic = this.showTopicInHeader(topic, offset);
|
const showTopic = this.showTopicInHeader(topic, offset);
|
||||||
if (showTopic !== this._lastShowTopic) {
|
if (showTopic !== this._lastShowTopic) {
|
||||||
this._lastShowTopic = showTopic;
|
|
||||||
|
|
||||||
if (showTopic) {
|
if (showTopic) {
|
||||||
this.appEvents.trigger('header:show-topic', topic);
|
this.appEvents.trigger('header:show-topic', topic);
|
||||||
|
this._lastShowTopic = true;
|
||||||
} else {
|
} else {
|
||||||
if (!DiscourseURL.isJumpScheduled()) {
|
if (!DiscourseURL.isJumpScheduled()) {
|
||||||
const loadingNear = topic.get('postStream.loadingNearPost') || 1;
|
const loadingNear = topic.get('postStream.loadingNearPost') || 1;
|
||||||
if (loadingNear === 1) {
|
if (loadingNear === 1) {
|
||||||
this.appEvents.trigger('header:hide-topic');
|
this.appEvents.trigger('header:hide-topic');
|
||||||
|
this._lastShowTopic = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,8 @@ export default class LockOn {
|
||||||
|
|
||||||
const interval = setInterval(() => {
|
const interval = setInterval(() => {
|
||||||
let top = this.elementTop();
|
let top = this.elementTop();
|
||||||
|
if (top < 0) { top = 0; }
|
||||||
|
|
||||||
const scrollTop = $(window).scrollTop();
|
const scrollTop = $(window).scrollTop();
|
||||||
|
|
||||||
if (typeof(top) === "undefined" || isNaN(top)) {
|
if (typeof(top) === "undefined" || isNaN(top)) {
|
||||||
|
|
|
@ -108,6 +108,10 @@ const DiscourseURL = Ember.Object.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
lockon.lock();
|
lockon.lock();
|
||||||
|
if (lockon.elementTop() < 1) {
|
||||||
|
_transitioning = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue