MCPcopy
hub / github.com/GrapesJS/grapesjs / __postAdd

Method __postAdd

packages/core/src/dom_components/model/Component.ts:421–437  ·  view source on GitHub ↗
(opts: { recursive?: boolean } = {})

Source from the content-addressed store, hash-verified

419 }
420
421 __postAdd(opts: { recursive?: boolean } = {}) {
422 const { em } = this;
423 const um = em?.UndoManager;
424 const comps = this.components();
425
426 if (!um || this.__hasUm) {
427 return;
428 }
429
430 if (um) {
431 um.add(comps);
432 um.add(this.getSelectors());
433 this.__hasUm = true;
434 }
435
436 opts.recursive && comps.map((c) => c.__postAdd(opts));
437 }
438
439 __postRemove() {
440 const { em } = this;

Callers 2

constructorMethod · 0.95
onAddMethod · 0.45

Calls 3

componentsMethod · 0.95
getSelectorsMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected