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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-05-17 15:08:06 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-17 15:08:06 +0300
commitf0a387b4a5f08d6739894455664b4d3cb1509cc6 (patch)
tree3c5b144fbb894189dfb9a61e47c53c54af4415f4 /app/assets/javascripts/sortable
parent91c2554bcf93c3c41aa830da4dd7a2d4b7483e2d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/sortable')
-rw-r--r--app/assets/javascripts/sortable/constants.js4
-rw-r--r--app/assets/javascripts/sortable/utils.js10
2 files changed, 10 insertions, 4 deletions
diff --git a/app/assets/javascripts/sortable/constants.js b/app/assets/javascripts/sortable/constants.js
index 7fddac00ab2..f5bb0a3b11f 100644
--- a/app/assets/javascripts/sortable/constants.js
+++ b/app/assets/javascripts/sortable/constants.js
@@ -1,3 +1,5 @@
+export const DRAG_CLASS = 'is-dragging';
+
/**
* Default config options for sortablejs.
* @type {object}
@@ -12,7 +14,7 @@
export const defaultSortableOptions = {
animation: 200,
forceFallback: true,
- fallbackClass: 'is-dragging',
+ fallbackClass: DRAG_CLASS,
fallbackOnBody: true,
ghostClass: 'is-ghost',
fallbackTolerance: 1,
diff --git a/app/assets/javascripts/sortable/utils.js b/app/assets/javascripts/sortable/utils.js
index c2c8fb03b58..88ac1295a39 100644
--- a/app/assets/javascripts/sortable/utils.js
+++ b/app/assets/javascripts/sortable/utils.js
@@ -1,13 +1,17 @@
/* global DocumentTouch */
-import { defaultSortableOptions } from './constants';
+import { defaultSortableOptions, DRAG_CLASS } from './constants';
export function sortableStart() {
- document.body.classList.add('is-dragging');
+ document.body.classList.add(DRAG_CLASS);
}
export function sortableEnd() {
- document.body.classList.remove('is-dragging');
+ document.body.classList.remove(DRAG_CLASS);
+}
+
+export function isDragging() {
+ return document.body.classList.contains(DRAG_CLASS);
}
export function getSortableDefaultOptions(options) {