Skip to content

Commit d5a78f0

Browse files
authored
Merge pull request #1482 from adumesny/develop
h5: moved the cursor style over to main css
2 parents a61acfd + bd5e365 commit d5a78f0

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

src/gridstack.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ $animation_speed: .3s !default;
6565
&.ui-resizable-resizing {
6666
z-index: 100;
6767

68-
> .grid-stack-item-content,
6968
> .grid-stack-item-content {
7069
box-shadow: 1px 4px 6px rgba(0, 0, 0, 0.2);
7170
opacity: 0.8;
@@ -125,4 +124,9 @@ $animation_speed: .3s !default;
125124
&.grid-stack-animate .grid-stack-item.grid-stack-placeholder{
126125
@include vendor(transition, left .0s, top .0s, height .0s, width .0s);
127126
}
127+
128+
// without this, the html5 drag will flicker between no-drop and drop when dragging over second grid
129+
&.ui-droppable.ui-droppable-over > *:not(.ui-droppable) {
130+
pointer-events: none;
131+
}
128132
}

src/gridstack.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ export class GridStack {
563563
this.el.parentNode.removeChild(this.el);
564564
}
565565
this._removeStylesheet();
566+
delete this.placeholder;
566567
delete this.engine;
567568
return this;
568569
}

src/h5/dd-droppable.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export class DDDroppable extends DDBaseImplement implements HTMLElementExtendOpt
2323
public el: HTMLElement;
2424
public option: DDDroppableOpt;
2525
private acceptable: boolean = null;
26-
private style;
2726

2827
constructor(el: HTMLElement, opts: DDDroppableOpt = {}) {
2928
super();
@@ -82,7 +81,6 @@ export class DDDroppable extends DDBaseImplement implements HTMLElementExtendOpt
8281
this.el.classList.add('ui-droppable');
8382
this.el.addEventListener('dragenter', this.dragEnter);
8483
this.setupAccept();
85-
this.createStyleSheet();
8684
return this;
8785
}
8886

@@ -162,20 +160,6 @@ export class DDDroppable extends DDBaseImplement implements HTMLElementExtendOpt
162160
return this;
163161
}
164162

165-
// TODO: share this with other instances and when do remove ???
166-
private createStyleSheet(): DDDroppable {
167-
const content = `.ui-droppable.ui-droppable-over > *:not(.ui-droppable) {pointer-events: none;}`;
168-
this.style = document.createElement('style');
169-
this.style.innerText = content;
170-
this.el.appendChild(this.style);
171-
return this;
172-
}
173-
174-
// TODO: not call
175-
private removeStyleSheet() {
176-
this.el.removeChild(this.style);
177-
}
178-
179163
private ui(drag: DDDraggable) {
180164
return {
181165
draggable: drag.el,

0 commit comments

Comments
 (0)