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