speed up scrolling on android
This commit is contained in:
parent
58b7df5480
commit
341a28402d
|
@ -25,10 +25,19 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
|
||||||
}.observes('controller.streamPercentage'),
|
}.observes('controller.streamPercentage'),
|
||||||
|
|
||||||
updateProgressBar: function() {
|
updateProgressBar: function() {
|
||||||
var $topicProgress = $('#topic-progress');
|
var $topicProgress = this.topicProgress;
|
||||||
if (!$topicProgress.length) return;
|
|
||||||
|
|
||||||
var totalWidth = $topicProgress.width();
|
// cache lookup
|
||||||
|
if (!$topicProgress) {
|
||||||
|
$topicProgress = $('#topic-progress');
|
||||||
|
if (!$topicProgress.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.topicProgress = $topicProgress;
|
||||||
|
}
|
||||||
|
|
||||||
|
// speeds up stuff, bypass jquery slowness and extra checks
|
||||||
|
var totalWidth = $topicProgress[0].offsetWidth;
|
||||||
var progressWidth = this.get('controller.streamPercentage') * totalWidth;
|
var progressWidth = this.get('controller.streamPercentage') * totalWidth;
|
||||||
|
|
||||||
$topicProgress.find('.bg')
|
$topicProgress.find('.bg')
|
||||||
|
|
Loading…
Reference in New Issue