Remove snapping from scrollbar (people hate it)
This commit is contained in:
parent
d2ebf0436c
commit
b37e14fc62
|
@ -157,18 +157,9 @@ createWidget('timeline-scrollarea', {
|
||||||
const $area = $('.timeline-scrollarea');
|
const $area = $('.timeline-scrollarea');
|
||||||
const areaTop = $area.offset().top;
|
const areaTop = $area.offset().top;
|
||||||
|
|
||||||
const topic = this.attrs.topic;
|
|
||||||
const postStream = topic.get('postStream');
|
|
||||||
const total = postStream.get('filteredPostsCount');
|
|
||||||
const percentage = clamp(parseFloat(y - areaTop) / $area.height());
|
const percentage = clamp(parseFloat(y - areaTop) / $area.height());
|
||||||
const current = clamp(Math.floor(total * percentage) + 1, 1, total);
|
|
||||||
|
|
||||||
// If viewing the last post consider it 100%
|
this.state.percentage = percentage;
|
||||||
if (current === total) {
|
|
||||||
this.state.percentage = 1.0;
|
|
||||||
} else {
|
|
||||||
this.state.percentage = this._percentFor(topic, parseFloat(current));
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
commit() {
|
commit() {
|
||||||
|
|
Loading…
Reference in New Issue