Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7043258

Browse files
authored
Merge pull request #3007 from adumesny/master
revert this change lock change
2 parents b85a3e6 + 9032700 commit 7043258

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

demo/web2.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h1>Advanced Demo</h1>
6363

6464
let children = [
6565
{x: 0, y: 0, w: 4, h: 2, content: '1'},
66-
{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>'},
66+
{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>'},
6767
{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!'},
6868
{x: 10, y: 0, w: 2, h: 2, content: '4'},
6969
{x: 0, y: 2, w: 2, h: 2, content: '5'},

doc/CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Change log
66
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*
77

88
- [11.5.0-dev (TBD)](#1150-dev-tbd)
9+
- [11.5.1 (2025-03-23)](#1151-2025-03-23)
910
- [11.5.0 (2025-03-16)](#1150-2025-03-16)
1011
- [11.4.0 (2025-02-27)](#1140-2025-02-27)
1112
- [11.3.0 (2025-01-26)](#1130-2025-01-26)
@@ -125,6 +126,9 @@ Change log
125126
## 11.5.0-dev (TBD)
126127
* 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)
127128

129+
## 11.5.1 (2025-03-23)
130+
* revert: [#2981](https://github.com/gridstack/gridstack.js/issues/2981) Locked was incorrectly changed. fixed doc instead
131+
128132
## 11.5.0 (2025-03-16)
129133
* feat: [#2975](https://github.com/gridstack/gridstack.js/pull/2975) `prepareDragDrop(el, force)` option to force re-creation of the drag&drop event binding
130134
* 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

src/gridstack.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2366,16 +2366,14 @@ export class GridStack {
23662366
const noResize = node.noResize || this.opts.disableResize;
23672367

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

23812379
if (!node._initDD) {

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ export interface GridStackWidget extends GridStackPosition {
333333
noResize?: boolean;
334334
/** prevents direct moving by the user (default?: undefined = un-constrained) */
335335
noMove?: boolean;
336-
/** same as noMove+noResize but also prevents being pushed by other widgets or api (default?: undefined = un-constrained) */
336+
/** prevents being pushed by other widgets or api (default?: undefined = un-constrained), which is different from `noMove` (user action only) */
337337
locked?: boolean;
338338
/** value for `gs-id` stored on the widget (default?: undefined) */
339339
id?: string;

0 commit comments

Comments
 (0)