mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-04-16 17:05:09 -04:00
PERF: eliminate reflow on topic render
This commit is contained in:
parent
46ec6e671a
commit
68600f1dce
1 changed files with 4 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue