diff --git a/.eslintrc b/.eslintrc index f5933a3..52e8365 100644 --- a/.eslintrc +++ b/.eslintrc @@ -2,5 +2,8 @@ "extends": [ "dabapps/commonjs", "dabapps/browser", - ] + ], + "globals": { + "$": true + } } diff --git a/static/src/js/alpha/main.js b/static/src/js/alpha/main.js index b0e2b57..5e324dd 100755 --- a/static/src/js/alpha/main.js +++ b/static/src/js/alpha/main.js @@ -1,61 +1,45 @@ -/* - Alpha by HTML5 UP - html5up.net | @ajlkn - Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) -*/ - -(function($) { - $(function() { - - var $window = $(window), - $body = $('body'), - $header = $('#header'), - $banner = $('#banner'); - - // Fix: Placeholder polyfill. - $('form').placeholder(); - - // Dropdowns. - $('#nav > ul').dropotron({ - alignment: 'right' - }); - - // Off-Canvas Navigation. - - // Navigation Button. - $( - '
' - ) - .appendTo($body); - - // Navigation Panel. - $( - ' ' - ) - .appendTo($body) - .panel({ - delay: 500, - hideOnClick: true, - hideOnSwipe: true, - resetScroll: true, - resetForms: true, - side: 'left', - target: $body, - visibleClass: 'navPanel-visible' - }); - - // Fix: Remove navPanel transitions on WP<10 (poor/buggy performance). - - // Header. - // If the header is using "alt" styling and #banner is present, use scrollwatch - // to revert it back to normal styling once the user scrolls past the banner. - // Note: This is disabled on mobile devices. - }); - -})(jQuery); +'use strict'; +/* + Alpha by HTML5 UP + html5up.net | @ajlkn + Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) +*/ + +$(function() { + var $body = $('body'); + + // Fix: Placeholder polyfill. + $('form').placeholder(); + + // Dropdowns. + $('#nav > ul').dropotron({ + alignment: 'right' + }); + + // Navigation Button. + $( + ' ' + ).appendTo($body); + + // Navigation Panel. + $( + ' ' + ) + .appendTo($body) + .panel({ + delay: 500, + hideOnClick: true, + hideOnSwipe: true, + resetScroll: true, + resetForms: true, + side: 'left', + target: $body, + visibleClass: 'navPanel-visible' + }); +}); diff --git a/static/src/js/index.js b/static/src/js/index.js index d61ed27..ca8c5e5 100644 --- a/static/src/js/index.js +++ b/static/src/js/index.js @@ -1,3 +1,5 @@ +'use strict'; + require('./jquery-global'); require('bootstrap'); diff --git a/static/src/js/jquery-global.js b/static/src/js/jquery-global.js index acc50ad..4a31748 100644 --- a/static/src/js/jquery-global.js +++ b/static/src/js/jquery-global.js @@ -1,4 +1,6 @@ -const jQuery = require('jquery'); +'use strict'; + +var jQuery = require('jquery'); window.$ = jQuery; window.jQuery = jQuery;