From 5d76d08d5d30663623cb3e0276c9684ca23b6940 Mon Sep 17 00:00:00 2001 From: Sriram Hariharan Date: Thu, 10 Jan 2019 14:59:33 -0600 Subject: [PATCH] optimized update --- js/content.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/content.js b/js/content.js index 71e93a4b..7e2447e6 100644 --- a/js/content.js +++ b/js/content.js @@ -132,7 +132,6 @@ $(function () { chrome.runtime.onMessage.addListener( function (request, sender, sendResponse) { if (request.command == "updateCourseList") { - // console.log("hello"); update(); } }); @@ -186,14 +185,14 @@ function saveCourse() { }, function (response) { $("#saveCourse").text(response.label); $("#snackbar").text(response.done); - $("#snackbar").attr("class", "show"); + setTimeout(function () { + $("#snackbar").attr("class", "show"); + }, 300); setTimeout(function () { $("#snackbar").attr("class", ""); }, 3000); chrome.runtime.sendMessage({ command: "updateCourseList" - }, function () { - update(); }); }); }