Added drag scrolling for classes, changed theme

This commit is contained in:
Kenneth Jao 2017-04-13 01:49:29 -04:00
parent 8689a964f5
commit f7d742422d
2 changed files with 22 additions and 2 deletions

View File

@ -40,6 +40,11 @@ Template.login.rendered = function() {
Template.main.created = function() {
Session.set("mode", Session.get("user").preferences.mode);
Session.set("classInfo", null);
$(document).on('keyup', (e) => {
if(event.keyCode === 27 && $(".overlay").css("display") !== "none") {
$(".overlay").fadeOut(150);
}
});
/*if (Notification.permission !== "granted") {
Notification.requestPermission().then(function(result) {
@ -67,7 +72,22 @@ Template.classesMode.rendered = function() {
});
$(".mainClass .slimScrollBar").css("display", "none");
// Classes mode drag scrolling
var dX = 0;
var currX = 0;
var sidebar = $("#classesMode");
new Hammer(sidebar[0], {
domEvents: true
});
sidebar.on('panmove', function(e) {
dX = currX + (e.originalEvent.gesture.deltaX);
sidebar.scrollLeft(dX);
});
sidebar.on('panend', function(e) {
currX = dX;
});
};
// Global Helpers

View File

@ -62,7 +62,7 @@ themeColors = {
"userDropdownColor": "#2E312B",
"iconHighlight": "#70E6E6",
"modeHighlight": "#70E6E6",
"classCardColor":"#3C6567",
"classCardColor":"#32363C",
"textColor": "#FCF0F0"
}
};