summaryrefslogtreecommitdiff
path: root/assets/js/src
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-08-29 11:57:09 -0400
committerFrederic Guillot <fred@kanboard.net>2015-08-29 11:57:09 -0400
commit720d1bc3bd8688b56079ccda490ad0a11acc33e7 (patch)
treed83b57f40c41e6bcbd58a4423f3dc4184f012a17 /assets/js/src
parentf4c3ca999145ad7a9428cbadd609fad7d02df2c1 (diff)
Add delay of 1.5s for draggable items on touch devices
Diffstat (limited to 'assets/js/src')
-rw-r--r--assets/js/src/Board.js5
-rw-r--r--assets/js/src/Gantt.js2
2 files changed, 5 insertions, 2 deletions
diff --git a/assets/js/src/Board.js b/assets/js/src/Board.js
index d1cf6a48..13420e66 100644
--- a/assets/js/src/Board.js
+++ b/assets/js/src/Board.js
@@ -113,12 +113,13 @@ Board.prototype.dragAndDrop = function() {
var self = this;
$(".board-task-list").sortable({
forcePlaceholderSize: true,
- delay: 300,
+ delay: $.support.touch ? 1500 : 300,
distance: 5,
connectWith: ".board-task-list",
placeholder: "draggable-placeholder",
items: ".draggable-item",
stop: function(event, ui) {
+ ui.item.removeClass("draggable-item-selected");
self.save(
ui.item.attr('data-task-id'),
ui.item.parent().attr("data-column-id"),
@@ -127,6 +128,7 @@ Board.prototype.dragAndDrop = function() {
);
},
start: function(event, ui) {
+ ui.item.addClass("draggable-item-selected");
ui.placeholder.height(ui.item.height());
}
});
@@ -225,7 +227,6 @@ Board.prototype.hideColumn = function(columnId) {
$(".board-column-" + columnId + " .board-rotation").each(function() {
var position = $(".board-swimlane").position();
- // $(".board-column-task-collapsed").height($(window).height() - position.top);
$(this).css("width", $(".board-column-" + columnId + "").height());
});
diff --git a/assets/js/src/Gantt.js b/assets/js/src/Gantt.js
index 9e469bd3..3a4dc8ce 100644
--- a/assets/js/src/Gantt.js
+++ b/assets/js/src/Gantt.js
@@ -268,6 +268,7 @@ Gantt.prototype.listenForBlockResize = function(startDate) {
jQuery("div.ganttview-block", this.options.container).resizable({
grid: this.options.cellWidth,
handles: "e,w",
+ delay: $.support.touch ? 1500 : 300,
stop: function() {
var block = jQuery(this);
self.updateDataAndPosition(block, startDate);
@@ -282,6 +283,7 @@ Gantt.prototype.listenForBlockMove = function(startDate) {
jQuery("div.ganttview-block", this.options.container).draggable({
axis: "x",
+ delay: $.support.touch ? 1500 : 300,
grid: [this.options.cellWidth, this.options.cellWidth],
stop: function() {
var block = jQuery(this);