From 3a31f3031a99581ad3cf2714dc369f3ca71be28d Mon Sep 17 00:00:00 2001 From: devfake Date: Sun, 21 Jun 2015 17:14:53 +0200 Subject: [PATCH] enable client view change --- site/client/app/components/navigation.js | 11 ++++++++++- site/client/app/routes.js | 3 +++ site/client/app/views/navigation.html | 6 +++--- site/server/app/Exceptions/Handler.php | 1 + 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/site/client/app/components/navigation.js b/site/client/app/components/navigation.js index 9bce8fc..6e0a04a 100644 --- a/site/client/app/components/navigation.js +++ b/site/client/app/components/navigation.js @@ -1,5 +1,14 @@ +var Router = require('director').Router; +var router = new Router(); + module.exports = { - template: require('../views/navigation.html') + template: require('../views/navigation.html'), + + methods: { + changeView: function(view) { + router.setRoute('test'); + } + } }; \ No newline at end of file diff --git a/site/client/app/routes.js b/site/client/app/routes.js index 1c39c52..e6a065e 100644 --- a/site/client/app/routes.js +++ b/site/client/app/routes.js @@ -9,6 +9,9 @@ module.exports = { app.section = 'inner'; }); + router.on('/test', function() { + }) + this.configure(); router.init(); }, diff --git a/site/client/app/views/navigation.html b/site/client/app/views/navigation.html index 875830d..2e85955 100644 --- a/site/client/app/views/navigation.html +++ b/site/client/app/views/navigation.html @@ -1,7 +1,7 @@ diff --git a/site/server/app/Exceptions/Handler.php b/site/server/app/Exceptions/Handler.php index 75bb3d4..acb80a9 100755 --- a/site/server/app/Exceptions/Handler.php +++ b/site/server/app/Exceptions/Handler.php @@ -5,6 +5,7 @@ use Exception; use Symfony\Component\HttpKernel\Exception\HttpException; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; + use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; class Handler extends ExceptionHandler {