summaryrefslogtreecommitdiff
path: root/assets/js/src
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/src')
-rw-r--r--assets/js/src/BoardDragAndDrop.js2
-rw-r--r--assets/js/src/Gantt.js40
-rw-r--r--assets/js/src/Popover.js11
3 files changed, 29 insertions, 24 deletions
diff --git a/assets/js/src/BoardDragAndDrop.js b/assets/js/src/BoardDragAndDrop.js
index 9c0c2aaf..4d2ae3ec 100644
--- a/assets/js/src/BoardDragAndDrop.js
+++ b/assets/js/src/BoardDragAndDrop.js
@@ -42,7 +42,7 @@ Kanboard.BoardDragAndDrop.prototype.dragAndDrop = function() {
}
};
- if ($.support.touch) {
+ if (isMobile.any) {
$(".task-board-sort-handle").css("display", "inline");
params["handle"] = ".task-board-sort-handle";
}
diff --git a/assets/js/src/Gantt.js b/assets/js/src/Gantt.js
index 584df087..96479d36 100644
--- a/assets/js/src/Gantt.js
+++ b/assets/js/src/Gantt.js
@@ -81,11 +81,11 @@ Kanboard.Gantt.prototype.renderVerticalHeader = function() {
}
else {
content
- .append(jQuery("<a>", {"href": this.data[i].board_link, "target": "_blank", "title": $(this.options.container).data("label-board-link")}).append('<i class="fa fa-th"></i>'))
+ .append(jQuery("<a>", {"href": this.data[i].board_link, "title": $(this.options.container).data("label-board-link")}).append('<i class="fa fa-th"></i>'))
.append("&nbsp;")
- .append(jQuery("<a>", {"href": this.data[i].gantt_link, "target": "_blank", "title": $(this.options.container).data("label-gantt-link")}).append('<i class="fa fa-sliders"></i>'))
+ .append(jQuery("<a>", {"href": this.data[i].gantt_link, "title": $(this.options.container).data("label-gantt-link")}).append('<i class="fa fa-sliders"></i>'))
.append("&nbsp;")
- .append(jQuery("<a>", {"href": this.data[i].link, "target": "_blank"}).append(this.data[i].title));
+ .append(jQuery("<a>", {"href": this.data[i].link}).append(this.data[i].title));
}
seriesDiv.append(jQuery("<div>", {"class": "ganttview-vtheader-series-name"}).append(content));
@@ -205,20 +205,6 @@ Kanboard.Gantt.prototype.addBlocks = function(slider, start) {
block.data("record", series);
this.setBarColor(block, series);
- if (series.progress != "0%") {
- block.append(jQuery("<div>", {
- "css": {
- "z-index": 0,
- "position": "absolute",
- "top": 0,
- "bottom": 0,
- "background-color": series.color.border,
- "width": series.progress,
- "opacity": 0.4
- }
- }));
- }
-
jQuery(rows[rowIdx]).append(block);
rowIdx = rowIdx + 1;
}
@@ -232,7 +218,7 @@ Kanboard.Gantt.prototype.getVerticalHeaderTooltip = function(record) {
tooltip = "<strong>" + record.column_title + "</strong> (" + record.progress + ")<br/>" + record.title;
}
else {
- var types = ["managers", "members"];
+ var types = ["project-manager", "project-member"];
for (var index in types) {
var type = types[index];
@@ -240,7 +226,9 @@ Kanboard.Gantt.prototype.getVerticalHeaderTooltip = function(record) {
var list = jQuery("<ul>");
for (var user_id in record.users[type]) {
- list.append(jQuery("<li>").append(record.users[type][user_id]));
+ if (user_id) {
+ list.append(jQuery("<li>").append(record.users[type][user_id]));
+ }
}
tooltip += "<p><strong>" + $(this.options.container).data("label-" + type) + "</strong></p>" + list[0].outerHTML;
@@ -279,6 +267,20 @@ Kanboard.Gantt.prototype.setBarColor = function(block, record) {
else {
block.css("background-color", record.color.background);
block.css("border-color", record.color.border);
+
+ if (record.progress != "0%") {
+ block.append(jQuery("<div>", {
+ "css": {
+ "z-index": 0,
+ "position": "absolute",
+ "top": 0,
+ "bottom": 0,
+ "background-color": record.color.border,
+ "width": record.progress,
+ "opacity": 0.4
+ }
+ }));
+ }
}
};
diff --git a/assets/js/src/Popover.js b/assets/js/src/Popover.js
index 216d6bf5..e5e8ea81 100644
--- a/assets/js/src/Popover.js
+++ b/assets/js/src/Popover.js
@@ -67,10 +67,13 @@ Kanboard.Popover.prototype.close = function(e) {
Kanboard.Popover.prototype.ajaxReload = function(data, request, self) {
var redirect = request.getResponseHeader("X-Ajax-Redirect");
- if (redirect) {
- window.location = redirect === 'self' ? window.location.href.split("#")[0] : redirect;
- }
- else {
+ if (redirect === 'self') {
+ window.location.reload();
+ } else if (redirect && redirect.indexOf('#') > -1) {
+ window.location = redirect.split('#')[0];
+ } else if (redirect) {
+ window.location = redirect;
+ } else {
$("#popover-content").html(data);
$("#popover-content input[autofocus]").focus();
self.executeOnOpenedListeners();