page scrolling slowdown

This commit is contained in:
Kenneth Jao 2017-05-01 23:23:16 -04:00
parent b45fbe52ac
commit d5fbaf950d
2 changed files with 6 additions and 3 deletions

View File

@ -427,12 +427,14 @@ input {
overflow-x: auto;
overflow-y: hidden;
cursor: -webkit-grab;
white-space: nowrap;
}
.mainClass {
width: 100%;
box-shadow: 2px 2px 15px 0px #090909;
cursor: default !important;
}
.classWrapper {

View File

@ -112,17 +112,18 @@ Template.classesMode.rendered = function() {
var area = $("#classesMode");
var clickX = 0;
var reducer = 0.5;
area.on({
'mousemove': function(e) {
if(clicked && !dragging) {
area.scrollLeft(area.scrollLeft() + (clickX - e.pageX));
clickX = e.pageX;
area.scrollLeft(area.scrollLeft() + (clickX - reducer*e.pageX));
clickX = reducer*e.pageX;
}
},
'mousedown': function(e) {
clicked = true;
clickX = e.pageX;
clickX = reducer*e.pageX;
},
'mouseup': function() {
clicked = false;