From 2f0fe4ae6811636791a094908d852dd4ec786b4e Mon Sep 17 00:00:00 2001 From: sghsri Date: Sun, 27 Oct 2019 10:29:54 -0500 Subject: [PATCH] more deconstructing --- js/Template.js | 8 ++------ js/config.js | 3 +++ js/import.js | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/js/Template.js b/js/Template.js index 66bb66d5..954d8f19 100644 --- a/js/Template.js +++ b/js/Template.js @@ -171,15 +171,11 @@ Template.Popup = class { } } Template.Import = class { - - static button_text_default = "Import to UT Reg +"; - static waitlist_button_text_default = "Import Waitlists to UT Reg +"; - static button_success = "Courses Saved!"; static import_button() { - return `
`; + return `
`; } static waitlist_import_button() { - return `
`; + return `
`; } } diff --git a/js/config.js b/js/config.js index 448e2aa2..5ad8a167 100644 --- a/js/config.js +++ b/js/config.js @@ -54,3 +54,6 @@ Text.emptyText = function(){ return arr[index]; } +Text.button_text_default = "Import to UT Reg +"; +Text.waitlist_button_text_default = "Import Waitlists to UT Reg +"; +Text.button_success = "Courses Saved!"; diff --git a/js/import.js b/js/import.js index dc3c332c..a022589b 100644 --- a/js/import.js +++ b/js/import.js @@ -30,8 +30,8 @@ $(function () { function importButtonAnimation(button) { let is_waitlisted_button = $(button).attr('id') == "import_waitlist"; - let return_text = is_waitlisted_button ? Template.Import.waitlist_button_text_default : Template.Import.button_text_default; - $(button).text(Template.Import.button_success).css("background-color", Colors.open); + let return_text = is_waitlisted_button ? Text.waitlist_button_text_default : Text.button_text_default; + $(button).text(Text.button_success).css("background-color", Colors.open); setTimeout(function () { $(button).html(return_text).css('background-color', Colors.waitlisted); }, 1000); @@ -135,4 +135,4 @@ function getDayTimeArray(row, course_info) { } } return day_time_array; -} \ No newline at end of file +}