From 833bd3f8a90b604f4ab289dab9366c0032ce5216 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sat, 19 Jul 2014 22:08:07 -0230 Subject: Add Task CSV export and Kanboard CLI --- assets/js/app.js | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) (limited to 'assets/js') diff --git a/assets/js/app.js b/assets/js/app.js index 2b65da99..bf98d689 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -28,8 +28,8 @@ var Kanboard = (function() { }, // Return true if the page is visible - IsVisible: function() - { + IsVisible: function() { + var property = ""; if (typeof document.hidden !== "undefined") { @@ -47,6 +47,17 @@ var Kanboard = (function() { } return true; + }, + + // Common init + Before: function() { + + // Datepicker + $(".form-date").datepicker({ + showOtherMonths: true, + selectOtherMonths: true, + dateFormat: 'yy-mm-dd' + }); } }; @@ -228,12 +239,7 @@ Kanboard.Task = (function() { return { Init: function() { - // Datepicker for the due date - $("#form-date_due").datepicker({ - showOtherMonths: true, - selectOtherMonths: true, - dateFormat: 'yy-mm-dd' - }); + Kanboard.Before(); // Image preview for attachments $(".file-popover").click(Kanboard.Popover); @@ -243,13 +249,28 @@ Kanboard.Task = (function() { })(); +// Project related functions +Kanboard.Project = (function() { + + return { + Init: function() { + Kanboard.Before(); + } + }; + +})(); + + // Initialization $(function() { if ($("#board").length) { Kanboard.Board.Init(); } - else { + else if ($("#task-section").length) { Kanboard.Task.Init(); } + else if ($("#project-section").length) { + Kanboard.Project.Init(); + } }); -- cgit v1.2.3