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
4 changes: 4 additions & 0 deletions doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Change log
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*

- [10.3.0-dev (TBD)](#1030-dev-tbd)
- [10.3.0 (2024-06-26)](#1030-2024-06-26)
- [10.2.1 (2024-06-23)](#1021-2024-06-23)
- [10.2.0 (2024-06-02)](#1020-2024-06-02)
Expand Down Expand Up @@ -112,6 +113,9 @@ Change log

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## 10.3.0-dev (TBD)
* fix: [#2734](https://github.com/gridstack/gridstack.js/bug/2734) rotate() JS error

## 10.3.0 (2024-06-26)
* fix: [#2720](https://github.com/gridstack/gridstack.js/pull/2720) load() now creates widgets in order (used to be reverse due to old collision code)

Expand Down
3 changes: 3 additions & 0 deletions src/gridstack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,10 @@ export class GridStack {
rot.x = n.x + pivotX - (n.h - (pivotY+1));
rot.y = (n.y + pivotY) - pivotX;
}
Object.keys(rot).forEach(k => { if (rot[k] === undefined) delete rot[k]; });
const _orig = n._orig;
this.update(el, rot);
n._orig = _orig; // restore as move() will delete it
});
return this;
}
Expand Down
5 changes: 4 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,10 @@ export class Utils {
}

/** swap the given object 2 field values */
public static swap(o: unknown, a: string, b: string): void { const tmp = o[a]; o[a] = o[b]; o[b] = tmp; }
public static swap(o: unknown, a: string, b: string): void {
if (!o) return;
const tmp = o[a]; o[a] = o[b]; o[b] = tmp;
}

/** returns true if event is inside the given element rectangle */
// Note: Safari Mac has null event.relatedTarget which causes #1684 so check if DragEvent is inside the coordinates instead
Expand Down