From 00e40f440db56fd9e88802eaab2cb61d8ddcf7dc Mon Sep 17 00:00:00 2001 From: Alain Dumesny Date: Thu, 27 Feb 2025 08:39:59 -0800 Subject: [PATCH] doc fix #2966 --- doc/README.md | 8 ++++---- src/gridstack.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/README.md b/doc/README.md index 655b4677d..3727e4bce 100644 --- a/doc/README.md +++ b/doc/README.md @@ -50,7 +50,7 @@ gridstack.js API - [`getGridItems(): GridItemHTMLElement[]`](#getgriditems-griditemhtmlelement) - [`getMargin()`](#getmargin) - [`isAreaEmpty(x, y, width, height)`](#isareaemptyx-y-width-height) - - [`load(layout: GridStackWidget[], boolean | ((w: GridStackWidget, add: boolean) => void) = true)`](#loadlayout-gridstackwidget-boolean--w-gridstackwidget-add-boolean--void---true) + - [`load(items: GridStackWidget[], addRemove: boolean | AddRemoveFcn = GridStack.addRemoveCB || true)`](#loaditems-gridstackwidget-addremove-boolean--addremovefcn--gridstackaddremovecb--true) - [`makeWidget(el)`](#makewidgetel) - [`makeSubGrid(el)`](#makesubgridel) - [`margin(value: numberOrString)`](#marginvalue-numberorstring) @@ -496,13 +496,13 @@ returns current margin value (undefined if all 4 sides don't match). Checks if specified area is empty. -### `load(layout: GridStackWidget[], boolean | ((w: GridStackWidget, add: boolean) => void) = true)` +### `load(items: GridStackWidget[], addRemove: boolean | AddRemoveFcn = GridStack.addRemoveCB || true)` - load the widgets from a list (see `save()`). This will call `update()` on each (matching by id) or add/remove widgets that are not there. -- Optional `addAndRemove` boolean (default true) or callback method can be passed to control if and how missing widgets can be added/removed, giving the user control of insertion. +- Optional `addRemove` boolean (default true) or callback method can be passed to control if and how missing widgets can be added/removed, giving the user control of insertion. - used to restore a grid layout for a saved layout list (see `save()`). -- `addAndRemove` boolean (default true) or callback method can be passed to control if and how missing widgets can be added/removed, giving the user control of insertion. +- `addRemove` boolean (default true) or callback method can be passed to control if and how missing widgets can be added/removed, giving the user control of insertion. - see [example](http://gridstackjs.com/demo/serialization.html) ### `makeWidget(el)` diff --git a/src/gridstack.ts b/src/gridstack.ts index e109f1208..0062a0072 100644 --- a/src/gridstack.ts +++ b/src/gridstack.ts @@ -699,8 +699,8 @@ export class GridStack { /** * load the widgets from a list. This will call update() on each (matching by id) or add/remove widgets that are not there. * - * @param layout list of widgets definition to update/create - * @param addAndRemove boolean (default true) or callback method can be passed to control if and how missing widgets can be added/removed, giving + * @param items list of widgets definition to update/create + * @param addRemove boolean (default true) or callback method can be passed to control if and how missing widgets can be added/removed, giving * the user control of insertion. * * @example