diff --git a/lms/static/coffee/src/modal.coffee b/lms/static/coffee/src/modal.coffee new file mode 100644 index 0000000000..3e77b43b78 --- /dev/null +++ b/lms/static/coffee/src/modal.coffee @@ -0,0 +1,6 @@ +class @Modal + initialize: (options) -> + @el = options['el'] + render: -> + @el.hide() + diff --git a/lms/static/js/sticky_filter.js b/lms/static/js/sticky_filter.js index 742d147782..895f024eb2 100644 --- a/lms/static/js/sticky_filter.js +++ b/lms/static/js/sticky_filter.js @@ -1,12 +1,14 @@ $(function() { - var offset = $('.filter nav').offset().top; + if ($('.filter nav').length > 0) { + var offset = $('.filter nav').offset().top; - $(window).scroll(function() { - if (offset <= window.pageYOffset) { - return $('.filter nav').addClass('fixed-top'); - } - else if (offset >= window.pageYOffset) { - return $('.filter nav').removeClass('fixed-top'); - } - }); + $(window).scroll(function() { + if (offset <= window.pageYOffset) { + return $('.filter nav').addClass('fixed-top'); + } + else if (offset >= window.pageYOffset) { + return $('.filter nav').removeClass('fixed-top'); + } + }); + } }); diff --git a/lms/templates/login_modal.html b/lms/templates/login_modal.html index 7d6b173a0e..adfe509d73 100644 --- a/lms/templates/login_modal.html +++ b/lms/templates/login_modal.html @@ -34,3 +34,6 @@ +