mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 18:01:01 +08:00
PERF: eliminate reflow on topic render
This commit is contained in:
parent
46ec6e671a
commit
68600f1dce
|
@ -37,10 +37,13 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
|
|||
return;
|
||||
}
|
||||
this._topicProgress = $topicProgress;
|
||||
// CAREFUL WITH THIS AXE
|
||||
// offsetWidth will cause a reflow
|
||||
this._progressWidth = $topicProgress[0].offsetWidth;
|
||||
}
|
||||
|
||||
// speeds up stuff, bypass jquery slowness and extra checks
|
||||
var totalWidth = $topicProgress[0].offsetWidth,
|
||||
var totalWidth = this._progressWidth,
|
||||
progressWidth = this.get('controller.streamPercentage') * totalWidth;
|
||||
|
||||
$topicProgress.find('.bg')
|
||||
|
|
Loading…
Reference in New Issue
Block a user