Welcome to mirror list, hosted at ThFree Co, Russian Federation.

sortable_default_options.js.es6 « mixins « boards « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 44addb3ea98180700315ce1561a9b30833be0202 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
((w) => {
  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.touchEnabled = ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch;

  gl.issueBoards.getBoardSortableDefaultOptions = (obj) => {
    let defaultSortOptions = {
      forceFallback: true,
      fallbackClass: 'is-dragging',
      fallbackOnBody: true,
      ghostClass: 'is-ghost',
      filter: '.has-tooltip',
      delay: gl.issueBoards.touchEnabled ? 100 : 0,
      scrollSensitivity: gl.issueBoards.touchEnabled ? 60 : 100,
      scrollSpeed: 20,
      onStart: gl.issueBoards.onStart,
      onEnd: gl.issueBoards.onEnd
    }

    Object.keys(obj).forEach((key) => { defaultSortOptions[key] = obj[key]; });
    return defaultSortOptions;
  };
})(window);