Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove 'ui-draggable' 'ui-resizable' #2258

Merged
merged 1 commit into from
Apr 9, 2023
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
5 changes: 3 additions & 2 deletions doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ Change log
<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## 7.3.0-dev (TBD)
* 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!
* 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.
* 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!
* 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.
* 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)`).

## 7.3.0 (2023-04-01)
* feat [#2229](https://github.com/gridstack/gridstack.js/pull/2229) support nonce for CSP. Thank you [@jedwards1211](https://github.com/jedwards1211)
Expand Down
3 changes: 2 additions & 1 deletion spec/e2e/html/810-many-columns.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ <h1>Many Columns demo</h1>
let options = {
column: COLUMNS,
cellHeight: 'auto',
margin: 1
margin: 1,
// staticGrid: true,
};
let grid = GridStack.init(options);

Expand Down
2 changes: 0 additions & 2 deletions src/dd-draggable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt
// this.dragEl.style.touchAction = 'none'; // not needed unlike pointerdown doc comment
}
this.el.classList.remove('ui-draggable-disabled');
this.el.classList.add('ui-draggable');
}

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

Expand Down
3 changes: 0 additions & 3 deletions src/dd-resizable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,19 @@ export class DDResizable extends DDBaseImplement implements HTMLElementExtendOpt

public enable(): void {
super.enable();
this.el.classList.add('ui-resizable');
this.el.classList.remove('ui-resizable-disabled');
this._setupAutoHide(this.option.autoHide);
}

public disable(): void {
super.disable();
this.el.classList.add('ui-resizable-disabled');
this.el.classList.remove('ui-resizable');
this._setupAutoHide(false);
}

public destroy(): void {
this._removeHandlers();
this._setupAutoHide(false);
this.el.classList.remove('ui-resizable');
delete this.el;
super.destroy();
}
Expand Down