fixed conflicts error and smoothed animation

This commit is contained in:
Sriram Hariharan
2019-01-12 01:04:24 -06:00
parent 3adbb95744
commit 8e747290a8

View File

@@ -6,6 +6,7 @@ setCourseList();
// var modhtml = '<div class=modal id=myModal><div class=modal-content><span class=close>×</span><div class=card><div class=cardcontainer></div></div></div></div>';
// $("#html").prepend(modhtml);
getSemesters();
var canremove = true;
function setCourseList() {
$("#courseList").empty()
@@ -106,7 +107,7 @@ function updateConflicts() {
text += "<br>";
}
}
$("#courseList").prepend("<p style='font-size:small; font-weight:bold; color:red; margin:5px 5px 5px 10px'>" + text + "</>");
$("#courseList").prepend("<p id='conflict' style='font-size:small; font-weight:bold; color:red; margin:5px 5px 5px 10px'>" + text + "</>");
}
});
}
@@ -141,7 +142,9 @@ $(document).ready(function () {
/* clear the conflict messages, then remove the course and updateConflicts. update the tabs*/
$(this).find("#listRemove").click(function () {
var thisForm = this;
$(thisForm).closest("ul").find(">p").remove();
if (canremove) {
canremove = false;
$(thisForm).closest("ul").find("#conflict").remove();
chrome.runtime.sendMessage({
command: "courseStorage",
course: courses[$(thisForm).closest("li").attr("id")],
@@ -151,6 +154,8 @@ $(document).ready(function () {
if ($(thisForm).closest("ul").children(':visible').length === 1) {
showEmpty();
}
canremove = true;
console.log('computedconflicts');
updateConflicts();
chrome.tabs.query({}, function (tabs) {
for (var i = 0; i < tabs.length; i++) {
@@ -160,6 +165,8 @@ $(document).ready(function () {
}
});
});
}
});
/* Show the times popout and more info options*/
if ($(this).find("#moreInfo").is(":hidden")) {
@@ -223,7 +230,7 @@ $(document).ready(function () {
exportlink.setAttribute('download', 'my_courses.json');
exportlink.click();
} else {
alert('You have no Saved Courses to export.');
alert('No Saved Courses to Export.');
}
});
});