Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/gridstack.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ $animation_speed: .3s !default;
&.ui-resizable-resizing {
z-index: 100;

> .grid-stack-item-content,
> .grid-stack-item-content {
box-shadow: 1px 4px 6px rgba(0, 0, 0, 0.2);
opacity: 0.8;
Expand Down Expand Up @@ -125,4 +124,9 @@ $animation_speed: .3s !default;
&.grid-stack-animate .grid-stack-item.grid-stack-placeholder{
@include vendor(transition, left .0s, top .0s, height .0s, width .0s);
}

// without this, the html5 drag will flicker between no-drop and drop when dragging over second grid
&.ui-droppable.ui-droppable-over > *:not(.ui-droppable) {
pointer-events: none;
}
}
1 change: 1 addition & 0 deletions src/gridstack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ export class GridStack {
this.el.parentNode.removeChild(this.el);
}
this._removeStylesheet();
delete this.placeholder;
delete this.engine;
return this;
}
Expand Down
16 changes: 0 additions & 16 deletions src/h5/dd-droppable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export class DDDroppable extends DDBaseImplement implements HTMLElementExtendOpt
public el: HTMLElement;
public option: DDDroppableOpt;
private acceptable: boolean = null;
private style;

constructor(el: HTMLElement, opts: DDDroppableOpt = {}) {
super();
Expand Down Expand Up @@ -82,7 +81,6 @@ export class DDDroppable extends DDBaseImplement implements HTMLElementExtendOpt
this.el.classList.add('ui-droppable');
this.el.addEventListener('dragenter', this.dragEnter);
this.setupAccept();
this.createStyleSheet();
return this;
}

Expand Down Expand Up @@ -162,20 +160,6 @@ export class DDDroppable extends DDBaseImplement implements HTMLElementExtendOpt
return this;
}

// TODO: share this with other instances and when do remove ???
private createStyleSheet(): DDDroppable {
const content = `.ui-droppable.ui-droppable-over > *:not(.ui-droppable) {pointer-events: none;}`;
this.style = document.createElement('style');
this.style.innerText = content;
this.el.appendChild(this.style);
return this;
}

// TODO: not call
private removeStyleSheet() {
this.el.removeChild(this.style);
}

private ui(drag: DDDraggable) {
return {
draggable: drag.el,
Expand Down