8000 revert this change lock change by adumesny · Pull Request #3007 · gridstack/gridstack.js · GitHub
[go: up one dir, main page]

Skip to content

revert this change lock change #3007

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

Merged
merged 1 commit into from
Mar 24, 2025
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
2 changes: 1 addition & 1 deletion demo/web2.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ <h1>Advanced Demo</h1>

let children = [
{x: 0, y: 0, w: 4, h: 2, content: '1'},
{x: 4, y: 0, w: 4, h: 4, locked: true, content: 'I can\'t be moved or dragged, nor pushed by others!<br><ion-icon name="ios-lock"></ion-icon>'},
{x: 4, y: 0, w: 4, h: 4, locked: true, content: 'locked: can\'t be pushed by others, only user!<br><ion-icon name="ios-lock"></ion-icon>'},
{x: 8, y: 0, w: 2, h: 2, minW: 2, noResize: true, content: '<p class="card-text text-center" style="margin-bottom: 0">Drag me!<p class="card-text text-center"style="margin-bottom: 0"><ion-icon name="hand"></ion-icon><p class="card-text text-center" style="margin-bottom: 0">...but don\'t resize me!'},
{x: 10, y: 0, w: 2, h: 2, content: '4'},
{x: 0, y: 2, w: 2, h: 2, content: '5'},
Expand Down
4 changes: 4 additions & 0 deletions doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Change log
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*

- [11.5.0-dev (TBD)](#1150-dev-tbd)
- [11.5.1 (2025-03-23)](#1151-2025-03-23)
- [11.5.0 (2025-03-16)](#1150-2025-03-16)
- [11.4.0 (2025-02-27)](#1140-2025-02-27)
- [11.3.0 (2025-01-26)](#1130-2025-01-26)
Expand Down Expand Up @@ -125,6 +126,9 @@ Change log
## 11.5.0-dev (TBD)
* feat: [#2854](https://github.com/gridstack/gridstack.js/pull/2854) Removed dynamic stylesheet and migrated to CSS vars. Thank you [lmartorella](https://github.com/lmartorella)

## 11.5.1 (2025-03-23)
* revert: [#2981](https://github.com/gridstack/gridstack.js/issues/2981) Locked was incorrectly changed. fixed doc instead

## 11.5.0 (2025-03-16)
* feat: [#2975](https://github.com/gridstack/gridstack.js/pull/2975) `prepareDragDrop(el, force)` option to force re-creation of the drag&drop event binding
* feat: [#2989](https://github.com/gridstack/gridstack.js/pull/2989) new `updateOptions(o: GridStackOptions)` to update PARTIAL list of options after grid as been created
Expand Down
8000
8 changes: 3 additions & 5 deletions src/gridstack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2366,16 +2366,14 @@ export class GridStack {
const noResize = node.noResize || this.opts.disableResize;

// check for disabled grid first
const disable = node.locked || this.opts.staticGrid || (noMove && noResize);
const disable = this.opts.staticGrid || (noMove && noResize);
if (force || disable) {
if (node._initDD) {
this._removeDD(el); // nukes everything instead of just disable, will add some styles back next
delete node._initDD;
}
if (disable) {
el.classList.add('ui-draggable-disabled', 'ui-resizable-disabled'); // add styles one might depend on #1435
return this;
}
if (disable) el.classList.add('ui-draggable-disabled', 'ui-resizable-disabled'); // add styles one might depend on #1435
if (!force) return this;
}

if (!node._initDD) {
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ export interface GridStackWidget extends GridStackPosition {
noResize?: boolean;
/** prevents direct moving by the user (default?: undefined = un-constrained) */
noMove?: boolean;
/** same as noMove+noResize but also prevents being pushed by other widgets or api (default?: undefined = un-constrained) */
/** prevents being pushed by other widgets or api (default?: undefined = un-constrained), which is different from `noMove` (user action only) */
locked?: boolean;
/** value for `gs-id` stored on the widget (default?: undefined) */
id?: string;
Expand Down
0