From 84066bb234284e587d40820fac9590da66e8594a Mon Sep 17 00:00:00 2001 From: Kevin Dao Date: Tue, 13 Aug 2019 18:51:03 -0500 Subject: [PATCH 1/3] Added auto-closing of popup windows when clicked outside of the element. Fixed positioning of settings bar --- css/popup.css | 7 +++---- js/popup.js | 15 ++++++++++++++- popup.html | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/css/popup.css b/css/popup.css index ded50742..4adaf33a 100644 --- a/css/popup.css +++ b/css/popup.css @@ -85,10 +85,9 @@ i { } .settings { - position: absolute; - bottom: 0px; - right: 0px; + position: relative; display: flex; + float: right; vertical-align: middle; box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); transition: 0.3s; @@ -358,7 +357,7 @@ input[type=number]::-webkit-outer-spin-button { .simple-menu-option:hover { background-color: rgba(177, 175, 175, 0.200); transition-duration: 0.4s; - color: #FF9800; + /* color: #FF9800; */ } .simple-menu-option:focus { diff --git a/js/popup.js b/js/popup.js index f2622c92..c793fca4 100644 --- a/js/popup.js +++ b/js/popup.js @@ -2,8 +2,8 @@ var courses; setCourseList(); getSemesters(); -var can_remove = true; +var can_remove = true; function setCourseList() { $("#courseList").empty() @@ -79,6 +79,19 @@ function formatShortenedCourseName(course) { return `${department} ${number} (${course.unique})`; } +$(document).click(function(event) { + $target = $(event.target); + console.log($target); + // If we're not clicking on search button or search popup, and popup is visible, hide it + if (!$target.closest('#search').length && !$target.closest('#search-popup').length && $('#search-popup').is(":visible")) { + hideSearchPopup(); + } + + // If we're not clicking on import/export button or imp/exp popup, and popup is visible, hide it + if (!$target.closest('#impexp').length && !$target.closest('#import-export-popup').length && $('#import-export-popup').is(":visible")) { + hideImportExportPopup(); + } +}); $("#clear").click(function () { chrome.storage.sync.set({ diff --git a/popup.html b/popup.html index 3f24574c..8682d93f 100644 --- a/popup.html +++ b/popup.html @@ -19,7 +19,7 @@
-

+

Doesn't Look Like Anything To Me. From 69c80ec4120acd1b43f8f76b08d7f4df54b0ec18 Mon Sep 17 00:00:00 2001 From: Kevin Dao Date: Tue, 13 Aug 2019 18:52:47 -0500 Subject: [PATCH 2/3] Remove logging statement --- js/popup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/popup.js b/js/popup.js index 847df4e0..0445fc7c 100644 --- a/js/popup.js +++ b/js/popup.js @@ -81,7 +81,7 @@ function formatShortenedCourseName(course) { $(document).click(function(event) { $target = $(event.target); - console.log($target); + // If we're not clicking on search button or search popup, and popup is visible, hide it if (!$target.closest('#search').length && !$target.closest('#search-popup').length && $('#search-popup').is(":visible")) { hideSearchPopup(); From 998c40414aaabb52aba20275c5daabc2aefd185b Mon Sep 17 00:00:00 2001 From: Kevin Dao Date: Tue, 13 Aug 2019 18:56:35 -0500 Subject: [PATCH 3/3] Cleaning up styling --- css/popup.css | 23 +++++++++++++++++++++++ popup.html | 8 ++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/css/popup.css b/css/popup.css index 4adaf33a..993631fb 100644 --- a/css/popup.css +++ b/css/popup.css @@ -25,6 +25,29 @@ body { min-height: 400px; } +#courseList { + list-style-type: none; + padding: 5px; +} + +#empty { + font-weight: normal; + font-size: large; + margin: 60px 30px 180px 30px; + text-align: center; +} + +#empty #main { + margin-bottom: 5px; +} + +#empty span { + font-size: small; + display: table; + margin: 0 auto; + font-weight: bold; +} + .settingsbut { margin-right: 2px; border: 0px; diff --git a/popup.html b/popup.html index 8682d93f..cb8839d1 100644 --- a/popup.html +++ b/popup.html @@ -18,13 +18,13 @@
-
    -

    -
    Doesn't Look Like +
      +

      +
      Doesn't Look Like Anything To Me.
      - (No Courses Saved) + (No Courses Saved)