From 286b1935663ef3071ad6a0aae3078ad3a42b48e4 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Tue, 14 Oct 2014 22:02:35 -0400 Subject: Add a dashboard (first version) --- assets/js/app.js | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) (limited to 'assets/js') diff --git a/assets/js/app.js b/assets/js/app.js index 395dfb6e..7dcf04eb 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -67,6 +67,15 @@ var Kanboard = (function() { dateFormat: 'yy-mm-dd', constrainInput: false }); + + // Project select box + $("#board-selector").chosen({ + width: 180 + }); + + $("#board-selector").change(function() { + window.location = "?controller=board&action=show&project_id=" + $(this).val(); + }); } }; @@ -229,17 +238,11 @@ Kanboard.Board = (function() { return { Init: function() { - board_load_events(); - filter_load_events(); - // Project select box - $("#board-selector").chosen({ - width: 180 - }); + Kanboard.Before(); - $("#board-selector").change(function() { - window.location = "?controller=board&action=show&project_id=" + $(this).val(); - }); + board_load_events(); + filter_load_events(); } }; @@ -274,6 +277,18 @@ Kanboard.Project = (function() { })(); +// Dashboard related functions +Kanboard.Dashboard = (function() { + + return { + Init: function() { + Kanboard.Before(); + } + }; + +})(); + + // Initialization $(function() { if ($("#board").length) { @@ -282,6 +297,9 @@ $(function() { else if ($("#task-section").length) { Kanboard.Task.Init(); } + else if ($("#dashboard").length) { + Kanboard.Dashboard.Init(); + } else if ($("#project-section").length) { Kanboard.Project.Init(); } -- cgit v1.2.3