* Makes Editor.js interface
()
| 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 |
no test coverage detected