From a7c8d61369a4eade1c1e4e9254e60a573ba31a3c Mon Sep 17 00:00:00 2001 From: wwwredfish Date: Wed, 6 Nov 2013 16:44:14 +0600 Subject: [PATCH] tasks #64 #65 has been completed --- app/scripts/controllers/main.js | 1 + app/scripts/router.js | 2 +- app/scripts/views/composite/noteSidebar.js | 9 +++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/scripts/controllers/main.js b/app/scripts/controllers/main.js index 7c4ddab37..848844987 100644 --- a/app/scripts/controllers/main.js +++ b/app/scripts/controllers/main.js @@ -69,6 +69,7 @@ function(_, Backbone, Marionette, Modal, App, CollectionNotes, NoteForm, NoteIte * Index page */ index: function (notebook, page) { + this.notesFilter = 'active'; this.noteInit(notebook, page); console.log('index page'); }, diff --git a/app/scripts/router.js b/app/scripts/router.js index ad55617a7..b331f98eb 100644 --- a/app/scripts/router.js +++ b/app/scripts/router.js @@ -18,7 +18,7 @@ define(['app', 'marionette', 'controllers/main'], function(App, Marionette, Cont 'note/trashed/p:page/show/:id' : 'noteTrashed', // Notes with pagination : 'note/:notebook/p:page/show/:id' : 'noteShow', - 'note/:notebook/p:page' : 'noteInit', + 'note/:notebook/p:page' : 'index', // Notebooks routes : 'notebook/add' : 'notebookAdd', 'notebook/edit/:id' : 'notebookEdit', diff --git a/app/scripts/views/composite/noteSidebar.js b/app/scripts/views/composite/noteSidebar.js index 5864fe9d8..438a1fc5f 100644 --- a/app/scripts/views/composite/noteSidebar.js +++ b/app/scripts/views/composite/noteSidebar.js @@ -39,8 +39,9 @@ define([ 'j' : 'navigateBottom', 'k' : 'navigateTop', 'c' : 'toCreate', - 'g+f' : 'showFavorites', - 'g+t' : 'showTrashed' + 'g f' : 'showFavorites', + 'g t' : 'showTrashed', + 'g i' : 'showInbox' }, initialize: function () { @@ -75,6 +76,10 @@ define([ return Backbone.history.navigate('/note/favorite/p1', true); }, + showInbox: function() { + return Backbone.history.navigate('/note/0/p1', true); + }, + showTrashed: function() { return Backbone.history.navigate('/note/trashed/p1', true); },