diff options
author | Phil Hughes <me@iamphill.com> | 2016-08-05 18:19:45 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-08-17 19:12:47 +0300 |
commit | a3831192d96bf6ceae785b4c6adc132624d676eb (patch) | |
tree | 2adca66bd3f06dcb3281316ac9b84d4d6c160b34 | |
parent | 22f2f2318e96febb40df4dc046fb562a02c50d86 (diff) |
Added cursor for when moving
-rw-r--r-- | app/assets/javascripts/boards/components/board.js.es6 | 8 | ||||
-rw-r--r-- | app/assets/javascripts/boards/components/board_list.js.es6 | 16 | ||||
-rw-r--r-- | app/assets/stylesheets/pages/boards.scss | 15 |
3 files changed, 33 insertions, 6 deletions
diff --git a/app/assets/javascripts/boards/components/board.js.es6 b/app/assets/javascripts/boards/components/board.js.es6 index 1d4b63e7358..b81e0f74e45 100644 --- a/app/assets/javascripts/boards/components/board.js.es6 +++ b/app/assets/javascripts/boards/components/board.js.es6 @@ -48,8 +48,16 @@ forceFallback: true, fallbackClass: 'is-dragging', ghostClass: 'is-ghost', + scrollSensitivity: 150, + scrollSpeed: 50, onUpdate: function (e) { BoardsStore.moveList(e.oldIndex, e.newIndex); + }, + onStart: function () { + document.body.classList.add('is-dragging'); + }, + onEnd: function () { + document.body.classList.remove('is-dragging'); } }); } diff --git a/app/assets/javascripts/boards/components/board_list.js.es6 b/app/assets/javascripts/boards/components/board_list.js.es6 index 50acfeb5669..4cce8e52249 100644 --- a/app/assets/javascripts/boards/components/board_list.js.es6 +++ b/app/assets/javascripts/boards/components/board_list.js.es6 @@ -44,14 +44,18 @@ forceFallback: true, fallbackClass: 'is-dragging', ghostClass: 'is-ghost', - onAdd: (e) => { - let fromListId = e.from.getAttribute('data-board'); - fromListId = parseInt(fromListId) || fromListId; - let toListId = e.to.getAttribute('data-board'); - toListId = parseInt(toListId) || toListId; - const issueId = parseInt(e.item.getAttribute('data-issue')); + onAdd: function (e) { + const fromListId = parseInt(e.from.getAttribute('data-board')), + toListId = parseInt(e.to.getAttribute('data-board')), + issueId = parseInt(e.item.getAttribute('data-issue')); BoardsStore.moveCardToList(fromListId, toListId, issueId); + }, + onStart: function () { + document.body.classList.add('is-dragging'); + }, + onEnd: function () { + document.body.classList.remove('is-dragging'); } }); diff --git a/app/assets/stylesheets/pages/boards.scss b/app/assets/stylesheets/pages/boards.scss index c10d221d017..6d18bc4cad9 100644 --- a/app/assets/stylesheets/pages/boards.scss +++ b/app/assets/stylesheets/pages/boards.scss @@ -2,6 +2,13 @@ display: none; } +.is-dragging { + * { + cursor: -webkit-grabbing; + cursor: grabbing; + } +} + .dropdown-menu-issues-board-new { width: 320px; @@ -94,6 +101,8 @@ .board-header { border-top-left-radius: $border-radius-default; border-top-right-radius: $border-radius-default; + cursor: -webkit-grab; + cursor: grab; &.has-border { padding-top: ($gl-padding - 3px); @@ -212,10 +221,16 @@ border-radius: $border-radius-default; box-shadow: 0 1px 2px rgba(186, 186, 186, 0.5); list-style: none; + cursor: -webkit-grab; + cursor: grab; &:not(:last-child) { margin-bottom: 5px; } + + a { + cursor: pointer; + } } .card-title { |