diff options
author | Phil Hughes <me@iamphill.com> | 2016-08-19 10:09:22 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-08-19 10:09:22 +0100 |
commit | d1f4a812d403cc8aa9839fc0de1fa78de7462916 (patch) | |
tree | ed5c9e04c40bb76467af181112eb72e061d22c1b | |
parent | 67d9e9227744329cbc4e6cbf3ed04357e18ec207 (diff) | |
download | gitlab-ce-issue-boards-tooltip-hide.tar.gz |
Hides tooltip when draggingissue-boards-tooltip-hide
Fixes issue with cursor not changing when dragging
3 files changed, 15 insertions, 13 deletions
diff --git a/app/assets/javascripts/boards/components/board.js.es6 b/app/assets/javascripts/boards/components/board.js.es6 index e17784e7948..5ef6a1b2277 100644 --- a/app/assets/javascripts/boards/components/board.js.es6 +++ b/app/assets/javascripts/boards/components/board.js.es6 @@ -55,7 +55,7 @@ draggable: '.is-draggable', handle: '.js-board-handle', onEnd: (e) => { - document.body.classList.remove('is-dragging'); + gl.issueBoards.onEnd(); if (e.newIndex !== undefined && e.oldIndex !== e.newIndex) { const order = this.sortable.toArray(), diff --git a/app/assets/javascripts/boards/components/board_list.js.es6 b/app/assets/javascripts/boards/components/board_list.js.es6 index c5d74c36a5b..dceacb25452 100644 --- a/app/assets/javascripts/boards/components/board_list.js.es6 +++ b/app/assets/javascripts/boards/components/board_list.js.es6 @@ -64,9 +64,7 @@ Store.moving.issue = card.issue; Store.moving.list = card.list; - $('.has-tooltip').tooltip('hide') - .tooltip('disable'); - document.body.classList.add('is-dragging'); + gl.issueBoards.onStart(); }, onAdd: (e) => { gl.issueBoards.BoardsStore.moveIssueToList(Store.moving.list, this.list, Store.moving.issue); diff --git a/app/assets/javascripts/boards/mixins/sortable_default_options.js.es6 b/app/assets/javascripts/boards/mixins/sortable_default_options.js.es6 index ce1bb362be2..8e8d13ede5a 100644 --- a/app/assets/javascripts/boards/mixins/sortable_default_options.js.es6 +++ b/app/assets/javascripts/boards/mixins/sortable_default_options.js.es6 @@ -2,6 +2,17 @@ window.gl = window.gl || {}; window.gl.issueBoards = window.gl.issueBoards || {}; + gl.issueBoards.onStart = () => { + $('.has-tooltip').tooltip('hide') + .tooltip('disable'); + document.body.classList.add('is-dragging'); + }; + + gl.issueBoards.onEnd = () => { + $('.has-tooltip').tooltip('enable'); + document.body.classList.remove('is-dragging'); + }; + gl.issueBoards.getBoardSortableDefaultOptions = (obj) => { let defaultSortOptions = { forceFallback: true, @@ -11,15 +22,8 @@ filter: '.has-tooltip', scrollSensitivity: 100, scrollSpeed: 20, - onStart () { - $('.has-tooltip').tooltip('hide') - .tooltip('disable'); - document.body.classList.add('is-dragging'); - }, - onEnd () { - $('.has-tooltip').tooltip('enable'); - document.body.classList.remove('is-dragging'); - } + onStart: gl.issueBoards.onStart, + onEnd: gl.issueBoards.onEnd } Object.keys(obj).forEach((key) => { defaultSortOptions[key] = obj[key]; }); |