From a6eb7e6bf86671b4fea6107da52614a926cf10da Mon Sep 17 00:00:00 2001 From: Daniel Papp Date: Thu, 20 Aug 2020 13:17:19 -0400 Subject: [PATCH] started the addition of odu branding to the platform --- .prettierignore | 4 ++++ src/app.js | 25 +++++++++++-------------- src/index.html | 6 ++++-- src/style.sass | 14 ++++++++++++++ src/styles/_variables.sass | 22 +++++++++++++++++++++- 5 files changed, 54 insertions(+), 17 deletions(-) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..b8ea284 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +dist +src/assets +node_modules +.cache \ No newline at end of file diff --git a/src/app.js b/src/app.js index aa79f05..1eb7d8d 100644 --- a/src/app.js +++ b/src/app.js @@ -10,7 +10,7 @@ $(document).ready(() => { let path = course + '-' + moduleNum $('.content').attr( 'src', - `http://127.0.0.1:8080/src/assets/${path}/story.html` + `http://127.0.0.1:8080/src/assets/modules/${path}/story.html` ) }) } @@ -53,8 +53,9 @@ $(document).ready(() => { if ($('.breadcrumb-item').hasClass('is-active')) { $('#course-title').click(() => { $('#module-title').parent().removeClass('is-active') - $('#module-title').remove() + $('#module-title').text('') $('#course-title').parent().addClass('is-active') + $('.content').attr('src', '') }) } } @@ -99,8 +100,13 @@ $(document).ready(() => { //TODO: [CDI-3] implement sorting modules const sortModules = () => {} - //TODO: [CDI-5] reset search/sort - const resetFilter = () => {} + const resetFilter = () => { + $('.reset').css('visibility', 'initial') + $('.reset').click(() => { + $('#search').val('') + $('.dropdown').removeClass('is-active') + }) + } //removes course and module text from breadcrumb const removeBreadcrumb = () => { @@ -118,16 +124,6 @@ $(document).ready(() => { toggleDropdown(event.target) }) - //TODO: [AODP-13] show alt text if iframe returns 404 - const moduleUnavailable = () => { - if (!$('.content').attr('src', '')) { - console.log('module content not available.') - } else { - return null - } - } - moduleUnavailable() - const toggleDropdown = (e) => { if ($(e).parent().hasClass('is-active')) { $(e).parent().removeClass('is-active') @@ -142,6 +138,7 @@ $(document).ready(() => { const handleSearch = () => { $('#search').on('keyup', function () { + resetFilter() const value = $(this).val().toLowerCase() $('.dropdown').addClass('is-active') $('.module-link').filter(function () { diff --git a/src/index.html b/src/index.html index 23855d7..0ad5acb 100644 --- a/src/index.html +++ b/src/index.html @@ -10,11 +10,13 @@