Skip to content

Commit 9d50489

Browse files
Merge pull request #4 from tenfold/better-cursor-style-management
New parameter to set a cursor type and sortable ghost hidden
2 parents 3ded3f4 + 604342a commit 9d50489

File tree

6 files changed

+16
-6
lines changed

6 files changed

+16
-6
lines changed

Sortable.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,6 +1586,7 @@
15861586
css(ghostEl, 'mozTransform', cssMatrix);
15871587
css(ghostEl, 'msTransform', cssMatrix);
15881588
css(ghostEl, 'transform', cssMatrix);
1589+
css(ghostEl.parentElement, 'cursor', options.cursorType);
15891590
lastDx = dx;
15901591
lastDy = dy;
15911592
touchEvt = touch;
@@ -1633,10 +1634,11 @@
16331634
css(ghostEl, 'left', rect.left);
16341635
css(ghostEl, 'width', rect.width);
16351636
css(ghostEl, 'height', rect.height);
1636-
css(ghostEl, 'opacity', '0.8');
1637+
css(ghostEl, 'opacity', '0');
16371638
css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');
16381639
css(ghostEl, 'zIndex', '100000');
16391640
css(ghostEl, 'pointerEvents', 'none');
1641+
css(ghostEl.parentElement, 'cursor', options.cursorType);
16401642
Sortable.ghost = ghostEl;
16411643
container.appendChild(ghostEl); // Set transform-origin
16421644

Sortable.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modular/sortable.complete.esm.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1580,6 +1580,7 @@ Sortable.prototype =
15801580
css(ghostEl, 'mozTransform', cssMatrix);
15811581
css(ghostEl, 'msTransform', cssMatrix);
15821582
css(ghostEl, 'transform', cssMatrix);
1583+
css(ghostEl.parentElement, 'cursor', options.cursorType);
15831584
lastDx = dx;
15841585
lastDy = dy;
15851586
touchEvt = touch;
@@ -1627,10 +1628,11 @@ Sortable.prototype =
16271628
css(ghostEl, 'left', rect.left);
16281629
css(ghostEl, 'width', rect.width);
16291630
css(ghostEl, 'height', rect.height);
1630-
css(ghostEl, 'opacity', '0.8');
1631+
css(ghostEl, 'opacity', '0');
16311632
css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');
16321633
css(ghostEl, 'zIndex', '100000');
16331634
css(ghostEl, 'pointerEvents', 'none');
1635+
css(ghostEl.parentElement, 'cursor', options.cursorType);
16341636
Sortable.ghost = ghostEl;
16351637
container.appendChild(ghostEl); // Set transform-origin
16361638

modular/sortable.core.esm.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1580,6 +1580,7 @@ Sortable.prototype =
15801580
css(ghostEl, 'mozTransform', cssMatrix);
15811581
css(ghostEl, 'msTransform', cssMatrix);
15821582
css(ghostEl, 'transform', cssMatrix);
1583+
css(ghostEl.parentElement, 'cursor', options.cursorType);
15831584
lastDx = dx;
15841585
lastDy = dy;
15851586
touchEvt = touch;
@@ -1627,10 +1628,11 @@ Sortable.prototype =
16271628
css(ghostEl, 'left', rect.left);
16281629
css(ghostEl, 'width', rect.width);
16291630
css(ghostEl, 'height', rect.height);
1630-
css(ghostEl, 'opacity', '0.8');
1631+
css(ghostEl, 'opacity', '0');
16311632
css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');
16321633
css(ghostEl, 'zIndex', '100000');
16331634
css(ghostEl, 'pointerEvents', 'none');
1635+
css(ghostEl.parentElement, 'cursor', options.cursorType);
16341636
Sortable.ghost = ghostEl;
16351637
container.appendChild(ghostEl); // Set transform-origin
16361638

modular/sortable.esm.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1580,6 +1580,7 @@ Sortable.prototype =
15801580
css(ghostEl, 'mozTransform', cssMatrix);
15811581
css(ghostEl, 'msTransform', cssMatrix);
15821582
css(ghostEl, 'transform', cssMatrix);
1583+
css(ghostEl.parentElement, 'cursor', options.cursorType);
15831584
lastDx = dx;
15841585
lastDy = dy;
15851586
touchEvt = touch;
@@ -1627,10 +1628,11 @@ Sortable.prototype =
16271628
css(ghostEl, 'left', rect.left);
16281629
css(ghostEl, 'width', rect.width);
16291630
css(ghostEl, 'height', rect.height);
1630-
css(ghostEl, 'opacity', '0.8');
1631+
css(ghostEl, 'opacity', '0');
16311632
css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');
16321633
css(ghostEl, 'zIndex', '100000');
16331634
css(ghostEl, 'pointerEvents', 'none');
1635+
css(ghostEl.parentElement, 'cursor', options.cursorType);
16341636
Sortable.ghost = ghostEl;
16351637
container.appendChild(ghostEl); // Set transform-origin
16361638

src/Sortable.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,7 @@ Sortable.prototype = /** @lends Sortable.prototype */ {
836836
css(ghostEl, 'mozTransform', cssMatrix);
837837
css(ghostEl, 'msTransform', cssMatrix);
838838
css(ghostEl, 'transform', cssMatrix);
839+
css(ghostEl.parentElement, 'cursor', options.cursorType);
839840

840841
lastDx = dx;
841842
lastDy = dy;
@@ -895,10 +896,11 @@ Sortable.prototype = /** @lends Sortable.prototype */ {
895896
css(ghostEl, 'left', rect.left);
896897
css(ghostEl, 'width', rect.width);
897898
css(ghostEl, 'height', rect.height);
898-
css(ghostEl, 'opacity', '0.8');
899+
css(ghostEl, 'opacity', '0');
899900
css(ghostEl, 'position', (PositionGhostAbsolutely ? 'absolute' : 'fixed'));
900901
css(ghostEl, 'zIndex', '100000');
901902
css(ghostEl, 'pointerEvents', 'none');
903+
css(ghostEl.parentElement, 'cursor', options.cursorType);
902904

903905

904906
Sortable.ghost = ghostEl;

0 commit comments

Comments
 (0)