Skip to content

Commit

Permalink
removing backend interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
timhc22 committed Apr 20, 2015
1 parent a79147c commit 6c172b3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
17 changes: 15 additions & 2 deletions src/javascript/_backbone.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ $(function()
App.todoList.fetch(); // Loads list from local storage
},
events: {
'keypress .js-new-todo': 'createTodoOnEnter'
'keypress .js-new-todo': 'createTodoOnEnter',
//'click .js-route-home': 'routeHome',
//'click .js-route-pending': 'routePending',
//'click .js-route-completed': 'routeCompleted'
},
createTodoOnEnter: function(e){
if ( e.which !== 13 || !this.input.val().trim() ) { // ENTER_KEY = 13
Expand Down Expand Up @@ -198,7 +201,16 @@ $(function()
title: this.input.val().trim(),
completed: false
}
}
},
//routeHome: function(){
// App.router.navigate("/", true)
//},
//routePending: function(){
// App.router.navigate("/pending", true)
//},
//routeCompleted: function(){
// App.router.navigate("/completed", true)
//}
});

//--------------
Expand All @@ -220,6 +232,7 @@ $(function()
//--------------
App.router = new App.Router();
Backbone.history.start();
//Backbone.history.start({pushState: true});

App.headerView = new App.HeaderView();
App.footerView = new App.FooterView();
Expand Down
6 changes: 3 additions & 3 deletions src/views/_todos.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<h1>Todos</h1>
<input class="js-new-todo" placeholder="What needs to be done?">
<div>
<a href="#/">show all</a> |
<a href="#/pending">show pending</a> |
<a href="#/completed">show completed</a>
<a href="#" class="js-route-home">show all</a> |
<a href="#/pending" class="js-route-pending">show pending</a> |
<a href="#/completed" class="js-route-completed">show completed</a>
</div>
</header>
<section id="main">
Expand Down

0 comments on commit 6c172b3

Please sign in to comment.