summaryrefslogtreecommitdiff
path: root/assets/js/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/app.js')
-rw-r--r--assets/js/app.js39
1 files changed, 30 insertions, 9 deletions
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();
+ }
});