@@ -678,40 +678,47 @@ export class GridStack {
678678 }
679679
680680 /**
681- * Disables widgets moving/resizing. This is a shortcut for:
681+ * Temporarily disables widgets moving/resizing.
682+ * If you want a more permanent way (which freezes up resources) use `setStatic(true)` instead.
683+ * Note: no-op for static grid
684+ * This is a shortcut for:
682685 * @example
683686 * grid.enableMove(false);
684687 * grid.enableResize(false);
685688 */
686689 public disable ( ) : GridStack {
690+ if ( this . opts . staticGrid ) { return ; }
687691 this . enableMove ( false ) ;
688692 this . enableResize ( false ) ;
689693 this . _triggerEvent ( 'disable' ) ;
690694 return this ;
691695 }
692696
693697 /**
694- * Enables widgets moving/resizing. This is a shortcut for:
698+ * Re-enables widgets moving/resizing - see disable().
699+ * Note: no-op for static grid.
700+ * This is a shortcut for:
695701 * @example
696702 * grid.enableMove(true);
697703 * grid.enableResize(true);
698704 */
699705 public enable ( ) : GridStack {
706+ if ( this . opts . staticGrid ) { return ; }
700707 this . enableMove ( true ) ;
701708 this . enableResize ( true ) ;
702709 this . _triggerEvent ( 'enable' ) ;
703710 return this ;
704711 }
705712
706713 /**
707- * Enables/disables widget moving.
714+ * Enables/disables widget moving. No-op for static grids.
708715 *
709716 * @param doEnable
710717 * @param includeNewWidgets will force new widgets to be draggable as per
711718 * doEnable`s value by changing the disableDrag grid option (default: true).
712719 */
713720 public enableMove ( doEnable : boolean , includeNewWidgets = true ) : GridStack {
714- if ( doEnable && this . opts . staticGrid ) { return this ; } // can't move a static grid!
721+ if ( this . opts . staticGrid ) { return this ; } // can't move a static grid!
715722 this . getGridItems ( ) . forEach ( el => this . movable ( el , doEnable ) ) ;
716723 if ( includeNewWidgets ) {
717724 this . opts . disableDrag = ! doEnable ;
@@ -720,13 +727,13 @@ export class GridStack {
720727 }
721728
722729 /**
723- * Enables/disables widget resizing
730+ * Enables/disables widget resizing. No-op for static grids.
724731 * @param doEnable
725732 * @param includeNewWidgets will force new widgets to be draggable as per
726733 * doEnable`s value by changing the disableResize grid option (default: true).
727734 */
728735 public enableResize ( doEnable : boolean , includeNewWidgets = true ) : GridStack {
729- if ( doEnable && this . opts . staticGrid ) { return this ; } // can't size a static grid!
736+ if ( this . opts . staticGrid ) { return this ; } // can't size a static grid!
730737 this . getGridItems ( ) . forEach ( el => this . resizable ( el , doEnable ) ) ;
731738 if ( includeNewWidgets ) {
732739 this . opts . disableResize = ! doEnable ;
@@ -1465,13 +1472,13 @@ export class GridStack {
14651472 /* eslint-disable @typescript-eslint/no-unused-vars */
14661473
14671474 /**
1468- * Enables/Disables moving.
1475+ * Enables/Disables moving. No-op for static grids.
14691476 * @param els widget or selector to modify.
14701477 * @param val if true widget will be draggable.
14711478 */
14721479 public movable ( els : GridStackElement , val : boolean ) : GridStack { return this ; }
14731480 /**
1474- * Enables/Disables resizing.
1481+ * Enables/Disables resizing. No-op for static grids.
14751482 * @param els widget or selector to modify
14761483 * @param val if true widget will be resizable.
14771484 */
0 commit comments