Skip to content

Commit e7bac7a

Browse files
committed
remove 'ui-draggable' 'ui-resizable'
* more fix #2243 * remove `'ui-draggable'` and `'ui-resizable'` since wasn't used in CSS and we have the `-disabled` version when off (so we can use `not(xyz-disabled)`).
1 parent 32ccecc commit e7bac7a

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

doc/CHANGES.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@ Change log
8484
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
8585

8686
## 7.3.0-dev (TBD)
87-
* feat [#2243](https://github.com/gridstack/gridstack.js/issues/2243) removed `gs-min|max_w|h` attribute generated in CSS or written out as they are never used for rendering, only for initial load. This reduce our column/row CSS in half!
88-
* feat: also removed `gs-w='1'` and `gs-h='1'` dom attribute writing since we already have min-width/min-height set, no need to set more attributes.
87+
* optimize [#2243](https://github.com/gridstack/gridstack.js/issues/2243) removed `gs-min|max_w|h` attribute generated in CSS or written out as they are never used for rendering, only for initial load. This reduce our column/row CSS in half!
88+
* optimize: removed `gs-w='1'` and `gs-h='1'` dom attribute writing since we already have min-width/min-height set, no need to set more attributes.
89+
* optimize: remove `'ui-draggable'` and `'ui-resizable'` since wasn't used in CSS and we have the `-disabled` version when off (so we can use `not(xyz-disabled)`).
8990

9091
## 7.3.0 (2023-04-01)
9192
* feat [#2229](https://github.com/gridstack/gridstack.js/pull/2229) support nonce for CSP. Thank you [@jedwards1211](https://github.com/jedwards1211)

spec/e2e/html/810-many-columns.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ <h1>Many Columns demo</h1>
2626
let options = {
2727
column: COLUMNS,
2828
cellHeight: 'auto',
29-
margin: 1
29+
margin: 1,
30+
// staticGrid: true,
3031
};
3132
let grid = GridStack.init(options);
3233

src/dd-draggable.ts

-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt
9292
// this.dragEl.style.touchAction = 'none'; // not needed unlike pointerdown doc comment
9393
}
9494
this.el.classList.remove('ui-draggable-disabled');
95-
this.el.classList.add('ui-draggable');
9695
}
9796

9897
public disable(forDestroy = false): void {
@@ -103,7 +102,6 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt
103102
this.dragEl.removeEventListener('touchstart', touchstart);
104103
this.dragEl.removeEventListener('pointerdown', pointerdown);
105104
}
106-
this.el.classList.remove('ui-draggable');
107105
if (!forDestroy) this.el.classList.add('ui-draggable-disabled');
108106
}
109107

src/dd-resizable.ts

-3
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,19 @@ export class DDResizable extends DDBaseImplement implements HTMLElementExtendOpt
7373

7474
public enable(): void {
7575
super.enable();
76-
this.el.classList.add('ui-resizable');
7776
this.el.classList.remove('ui-resizable-disabled');
7877
this._setupAutoHide(this.option.autoHide);
7978
}
8079

8180
public disable(): void {
8281
super.disable();
8382
this.el.classList.add('ui-resizable-disabled');
84-
this.el.classList.remove('ui-resizable');
8583
this._setupAutoHide(false);
8684
}
8785

8886
public destroy(): void {
8987
this._removeHandlers();
9088
this._setupAutoHide(false);
91-
this.el.classList.remove('ui-resizable');
9289
delete this.el;
9390
super.destroy();
9491
}

0 commit comments

Comments
 (0)