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",
"version": "0.0.0",
"dependencies": {
"todomvc-common": "~0.1.4",
"director": "~1.2.0"
}
"name": "todomvc-vanillajs",
"version": "0.0.0",
"dependencies": {
"todomvc-common": "~0.1.4"
}
}
......@@ -38,7 +38,6 @@
<p>Created by <a href="http://twitter.com/oscargodson">Oscar Godson</a></p>
</footer>
<script src="bower_components/todomvc-common/base.js"></script>
<script src="bower_components/director/build/director.js"></script>
<script>
// Bootstrap app data
window.app = {};
......
/*global Router, $$, $ */
/*global $$, $ */
(function (window) {
'use strict';
......@@ -23,25 +23,13 @@
this.$clearCompleted = $$('#clear-completed');
this.$footer = $$('#footer');
this.router = new Router();
this.router.init();
window.addEventListener('load', function () {
this._updateFilterState();
}.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 () {
this._updateFilterState();
}.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