Skip to content

Commit b01afb1

Browse files
updated javascript to use let instead of var for variable declaration
1 parent 0728a3b commit b01afb1

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/js/app.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"use strict";
44

55
// Page specific actions
6-
var MYSITE = {
6+
const MYSITE = {
77
common: { // sitewide code
88
init: function() {
99

@@ -24,19 +24,18 @@
2424
};
2525

2626

27-
var UTIL = {
27+
const UTIL = {
2828
exec: function(controller, action) {
29-
var ns = MYSITE,
30-
action = (action === undefined) ? 'init' : action;
31-
if (controller !== '' && ns[controller] && typeof ns[controller][action] == 'function' ) {
32-
ns[controller][action]();
29+
let namespace = MYSITE;
30+
action = (action === undefined) ? 'init' : action;
31+
if (controller !== '' && namespace[controller] && typeof namespace[controller][action] == 'function' ) {
32+
namespace[controller][action]();
3333
}
3434
},
35-
3635
init: function() {
37-
var main = document.getElementById('main'),
38-
controller = main.getAttribute( 'data-controller' ),
39-
action = main.getAttribute( 'data-action' );
36+
let elm = document.getElementById('main');
37+
let controller = elm.getAttribute( 'data-controller' );
38+
let action = elm.getAttribute( 'data-action' );
4039
UTIL.exec( 'common' );
4140
UTIL.exec( controller );
4241
UTIL.exec( controller, action );

src/scss/app.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
@import "settings"; // <-- Set sitewide defaults
22
@import "components/mixins"; // Goodies!
33

4+
html {
5+
scroll-behavior: smooth;
6+
}
47
/* Demo */
58
body {
69
font-family: 'Roboto Condensed', sans-serif;

0 commit comments

Comments
 (0)