Commit b52fd2d2 authored by Sindre Sorhus's avatar Sindre Sorhus

VanillaJS - Remove Director

It wasn't used anyways and it's nicer to have no dependencies on the vanilla app.
parent 9295d162
{ {
"name": "todomvc-vanillajs", "name": "todomvc-vanillajs",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"todomvc-common": "~0.1.4", "todomvc-common": "~0.1.4"
"director": "~1.2.0" }
}
} }
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
<p>Created by <a href="http://twitter.com/oscargodson">Oscar Godson</a></p> <p>Created by <a href="http://twitter.com/oscargodson">Oscar Godson</a></p>
</footer> </footer>
<script src="bower_components/todomvc-common/base.js"></script> <script src="bower_components/todomvc-common/base.js"></script>
<script src="bower_components/director/build/director.js"></script>
<script> <script>
// Bootstrap app data // Bootstrap app data
window.app = {}; window.app = {};
......
/*global Router, $$, $ */ /*global $$, $ */
(function (window) { (function (window) {
'use strict'; 'use strict';
...@@ -23,25 +23,13 @@ ...@@ -23,25 +23,13 @@
this.$clearCompleted = $$('#clear-completed'); this.$clearCompleted = $$('#clear-completed');
this.$footer = $$('#footer'); this.$footer = $$('#footer');
this.router = new Router();
this.router.init();
window.addEventListener('load', function () { window.addEventListener('load', function () {
this._updateFilterState(); this._updateFilterState();
}.bind(this)); }.bind(this));
// Couldn't figure out how to get flatiron to run some code on all pages. I
// tried '*', but then it overwrites ALL handlers for all the other pages
// and only runs this.
window.addEventListener('hashchange', function () { window.addEventListener('hashchange', function () {
this._updateFilterState(); this._updateFilterState();
}.bind(this)); }.bind(this));
// Make sure on page load we start with a hash to trigger the flatiron and
// onhashchange routes
if (window.location.href.indexOf('#') === -1) {
window.location.hash = '#/';
}
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment