MCPcopy
hub / github.com/codex-team/editor.js / make

Method make

src/components/modules/ui.ts:276–311  ·  view source on GitHub ↗

* Makes Editor.js interface

()

Source from the content-addressed store, hash-verified

274 * Makes Editor.js interface
275 */
276 private make(): void {
277 /**
278 * Element where we need to append Editor.js
279 *
280 * @type {Element}
281 */
282 this.nodes.holder = $.getHolder(this.config.holder);
283
284 /**
285 * Create and save main UI elements
286 */
287 this.nodes.wrapper = $.make('div', [
288 this.CSS.editorWrapper,
289 ...(this.isRtl ? [ this.CSS.editorRtlFix ] : []),
290 ]);
291 this.nodes.redactor = $.make('div', this.CSS.editorZone);
292
293 /**
294 * If Editor has injected into the narrow container, enable Narrow Mode
295 *
296 * @todo Forced layout. Get rid of this feature
297 */
298 if (this.nodes.holder.offsetWidth < this.contentRect.width) {
299 this.nodes.wrapper.classList.add(this.CSS.editorWrapperNarrow);
300 }
301
302 /**
303 * Set customizable bottom zone height
304 */
305 this.nodes.redactor.style.paddingBottom = this.config.minHeight + 'px';
306
307 this.nodes.wrapper.appendChild(this.nodes.redactor);
308 this.nodes.holder.appendChild(this.nodes.wrapper);
309
310 this.bindReadOnlyInsensitiveListeners();
311 }
312
313 /**
314 * Appends CSS

Callers 8

prepareMethod · 0.95
copySelectedBlocksMethod · 0.45
splitMethod · 0.45
loadStylesMethod · 0.45
genHTMLMethod · 0.45
processHTMLMethod · 0.45
processPlainMethod · 0.45
composeMethod · 0.45

Calls 3

getHolderMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected