scrolling bug fix

This commit is contained in:
Kenneth Jao 2017-04-15 23:39:49 -04:00
parent d0e387df0e
commit 8501a4a2c7
2 changed files with 12 additions and 11 deletions

View File

@ -432,7 +432,7 @@ input {
}
.classWrapper {
width: 20vw;
width: 15vw;
height: 95%;
margin: 10px;
margin-top: 20px;
@ -450,13 +450,13 @@ input {
}
.classInfo {
padding: 6%;
padding: 1vw;
background-color: rgba(255,255,255,0.3); /* remove when class color */
cursor: pointer;
}
.mainClassName {
font-size: 2vw;
font-size: 1.5vw;
white-space: normal;
-webkit-filter: none !important;
@ -465,18 +465,18 @@ input {
}
.mainClassHour {
font-size: 1.1vw;
font-size: .8vw;
margin-top: 0;
pointer-events: none;
}
.mainClassTeacher {
font-size: 1.1vw;
font-size: .8vw;
pointer-events: none;
}
.creWork {
font-size: 1.1vw;
font-size: .8vw;
cursor: pointer;
box-shadow: 0px 5px 5px -2px #666;
@ -548,7 +548,7 @@ input {
}
.cWorkCont {
font-size: .97vw;
font-size: .8vw;
padding: 5%;
}

View File

@ -8,6 +8,9 @@ import './main.html';
var load = true;
var calWorkOpen = null;
var calWorkDate = null;
var dragging = false;
var clicked = false;
var defaultWork = {
name: "Name | Click here to edit...",
@ -31,8 +34,6 @@ Session.set("classDispHover", null); // Stores current hovered class filter.
Session.set("restrictText", {}); // Stores text for comment character restriction.
Session.set("confirmText", ""); // Stores text for confirmations.
var dragging = false;
// On render actions
Template.login.rendered = function() {
@ -75,12 +76,11 @@ Template.classesMode.rendered = function() {
$(".mainClass .slimScrollBar").css("display", "none");
var area = $("#classesMode");
var clicked = false;
var clickX = 0;
area.on({
'mousemove': function(e) {
if(clicked && !dragging) area.scrollLeft(area.scrollLeft() + (clickX - e.pageX)/50);
if(clicked && !dragging) area.scrollLeft(area.scrollLeft() + (clickX - e.pageX)/55);
},
'mousedown': function(e) {
clicked = true;
@ -960,6 +960,7 @@ startDragula = function() {
var els = document.getElementsByClassName("classWrapper");
if($(els[0]).hasClass("gu-transit")) return;
dragging = false;
clicked = false;
var final = [];
for (var i = 0; i < els.length; i++) {
var classid = els[i].getElementsByClassName("creWork")[0].getAttribute("classid");