Commit 0c0a6e43 authored by Sindre Sorhus's avatar Sindre Sorhus

KnockoutJS: Change routing lib

parent 05b46df1
......@@ -57,11 +57,8 @@
<p>Patches/fixes for cross-browser compat: <a href="http://twitter.com/addyosmani">Addy Osmani</a></p>
</footer>
<script src="../../assets/base.js"></script>
<script src="../../assets/director.min.js"></script>
<script src="js/lib/knockout.min.js"></script>
<!--Crossroad.js -->
<script src="../../assets/signals.min.js"></script>
<script src="../../assets/crossroads.min.js"></script>
<!-- / -->
<script src="js/app.js"></script>
</body>
</html>
......@@ -164,22 +164,6 @@
var viewModel = new ViewModel( todos || [] );
ko.applyBindings( viewModel );
//setup crossroads
crossroads.addRoute('all', function() {
viewModel.showMode('all');
});
crossroads.addRoute('active', function() {
viewModel.showMode('active');
});
crossroads.addRoute('completed', function() {
viewModel.showMode('completed');
});
window.onhashchange = function() {
crossroads.parse( location.hash.replace('#', '') );
};
crossroads.parse( location.hash.replace('#', '') );
// set up filter routing
Router({ '/:filter': viewModel.showMode }).init();
}());
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