From 9455df2635ac77889ab1c4f16e7661b8d871fd2e Mon Sep 17 00:00:00 2001 From: Martin Polden Date: Sun, 26 Jan 2014 21:57:59 +0100 Subject: [PATCH] Remove jQuery dep --- assets/js/app.js | 22 +++++++++++----------- assets/js/app.min.js | 1 - index.html | 3 +-- 3 files changed, 12 insertions(+), 14 deletions(-) delete mode 100644 assets/js/app.min.js diff --git a/assets/js/app.js b/assets/js/app.js index 280b896..ddfb05d 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -1,14 +1,14 @@ /*jslint es5: true, indent: 2, browser: true*/ -/*global jQuery: true*/ -(function ($) { +(function () { 'use strict'; - - $(document).ready(function () { - $('#select-command').on('change', function () { - $('.command').text($(this).val()); - }); - }); - -})(jQuery); - + var onLoad = function (event) { + var select = document.querySelector('#select-command'); + select.addEventListener('change', function () { + [].forEach.call(document.querySelectorAll('.command'), function (el) { + el.innerHTML = this.value; + }, this); + }); + } + document.addEventListener('DOMContentLoaded', onLoad); +})(); diff --git a/assets/js/app.min.js b/assets/js/app.min.js deleted file mode 100644 index c5a8c20..0000000 --- a/assets/js/app.min.js +++ /dev/null @@ -1 +0,0 @@ -!function($){"use strict";$(document).ready(function(){$("#select-command").on("change",function(){$(".command").text($(this).val())})})}(jQuery); \ No newline at end of file diff --git a/index.html b/index.html index 5ba8a75..f40db26 100644 --- a/index.html +++ b/index.html @@ -65,7 +65,6 @@ Fork me on GitHub - - +