@ckeditor/ckeditor5-ui 35.2.0 → 35.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +31 -23
- package/src/bindings/addkeyboardhandlingforgrid.js +45 -57
- package/src/bindings/clickoutsidehandler.js +15 -21
- package/src/bindings/injectcsstransitiondisabler.js +16 -20
- package/src/bindings/preventdefault.js +6 -8
- package/src/bindings/submithandler.js +5 -7
- package/src/button/button.js +5 -0
- package/src/button/buttonview.js +220 -259
- package/src/button/switchbuttonview.js +56 -71
- package/src/colorgrid/colorgridview.js +135 -197
- package/src/colorgrid/colortileview.js +37 -47
- package/src/colorgrid/utils.js +57 -66
- package/src/componentfactory.js +79 -93
- package/src/dropdown/button/dropdownbutton.js +5 -0
- package/src/dropdown/button/dropdownbuttonview.js +44 -57
- package/src/dropdown/button/splitbuttonview.js +159 -207
- package/src/dropdown/dropdownpanelfocusable.js +5 -0
- package/src/dropdown/dropdownpanelview.js +101 -112
- package/src/dropdown/dropdownview.js +396 -438
- package/src/dropdown/utils.js +164 -213
- package/src/editableui/editableuiview.js +125 -141
- package/src/editableui/inline/inlineeditableuiview.js +44 -54
- package/src/editorui/bodycollection.js +61 -75
- package/src/editorui/boxed/boxededitoruiview.js +91 -104
- package/src/editorui/editoruiview.js +30 -39
- package/src/focuscycler.js +214 -245
- package/src/formheader/formheaderview.js +58 -70
- package/src/icon/iconview.js +145 -111
- package/src/iframe/iframeview.js +37 -49
- package/src/index.js +0 -17
- package/src/input/inputview.js +170 -198
- package/src/inputnumber/inputnumberview.js +48 -56
- package/src/inputtext/inputtextview.js +14 -18
- package/src/label/labelview.js +44 -53
- package/src/labeledfield/labeledfieldview.js +212 -235
- package/src/labeledfield/utils.js +39 -57
- package/src/labeledinput/labeledinputview.js +190 -221
- package/src/list/listitemview.js +40 -50
- package/src/list/listseparatorview.js +15 -19
- package/src/list/listview.js +94 -115
- package/src/model.js +19 -25
- package/src/notification/notification.js +151 -202
- package/src/panel/balloon/balloonpanelview.js +535 -628
- package/src/panel/balloon/contextualballoon.js +611 -732
- package/src/panel/sticky/stickypanelview.js +238 -270
- package/src/template.js +1049 -1479
- package/src/toolbar/balloon/balloontoolbar.js +337 -424
- package/src/toolbar/block/blockbuttonview.js +32 -42
- package/src/toolbar/block/blocktoolbar.js +375 -477
- package/src/toolbar/normalizetoolbarconfig.js +17 -21
- package/src/toolbar/toolbarlinebreakview.js +15 -19
- package/src/toolbar/toolbarseparatorview.js +15 -19
- package/src/toolbar/toolbarview.js +866 -1053
- package/src/tooltipmanager.js +324 -353
- package/src/view.js +389 -430
- package/src/viewcollection.js +147 -178
- package/src/button/button.jsdoc +0 -165
- package/src/dropdown/button/dropdownbutton.jsdoc +0 -22
- package/src/dropdown/dropdownpanelfocusable.jsdoc +0 -27
|
@@ -2,155 +2,139 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* @module ui/editableui/editableuiview
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
8
|
import View from '../view';
|
|
11
|
-
|
|
12
9
|
/**
|
|
13
10
|
* The editable UI view class.
|
|
14
11
|
*
|
|
15
12
|
* @extends module:ui/view~View
|
|
16
13
|
*/
|
|
17
14
|
export default class EditableUIView extends View {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
// callback and render is called inside the already pending render.
|
|
144
|
-
// We need to be sure that callback is executed only when the value has changed from `true` to `false`.
|
|
145
|
-
// See https://github.com/ckeditor/ckeditor5/issues/1676.
|
|
146
|
-
function updateAfterRender( view ) {
|
|
147
|
-
editingView.once( 'change:isRenderingInProgress', ( evt, name, value ) => {
|
|
148
|
-
if ( !value ) {
|
|
149
|
-
update( view );
|
|
150
|
-
} else {
|
|
151
|
-
updateAfterRender( view );
|
|
152
|
-
}
|
|
153
|
-
} );
|
|
154
|
-
}
|
|
155
|
-
}
|
|
15
|
+
/**
|
|
16
|
+
* Creates an instance of EditableUIView class.
|
|
17
|
+
*
|
|
18
|
+
* @param {module:utils/locale~Locale} [locale] The locale instance.
|
|
19
|
+
* @param {module:engine/view/view~View} editingView The editing view instance the editable is related to.
|
|
20
|
+
* @param {HTMLElement} [editableElement] The editable element. If not specified, this view
|
|
21
|
+
* should create it. Otherwise, the existing element should be used.
|
|
22
|
+
*/
|
|
23
|
+
constructor(locale, editingView, editableElement) {
|
|
24
|
+
super(locale);
|
|
25
|
+
this.setTemplate({
|
|
26
|
+
tag: 'div',
|
|
27
|
+
attributes: {
|
|
28
|
+
class: [
|
|
29
|
+
'ck',
|
|
30
|
+
'ck-content',
|
|
31
|
+
'ck-editor__editable',
|
|
32
|
+
'ck-rounded-corners'
|
|
33
|
+
],
|
|
34
|
+
lang: locale.contentLanguage,
|
|
35
|
+
dir: locale.contentLanguageDirection
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* The name of the editable UI view.
|
|
40
|
+
*
|
|
41
|
+
* @member {String} #name
|
|
42
|
+
*/
|
|
43
|
+
this.name = null;
|
|
44
|
+
/**
|
|
45
|
+
* Controls whether the editable is focused, i.e. the user is typing in it.
|
|
46
|
+
*
|
|
47
|
+
* @observable
|
|
48
|
+
* @member {Boolean} #isFocused
|
|
49
|
+
*/
|
|
50
|
+
this.set('isFocused', false);
|
|
51
|
+
/**
|
|
52
|
+
* The element which is the main editable element (usually the one with `contentEditable="true"`).
|
|
53
|
+
*
|
|
54
|
+
* @private
|
|
55
|
+
* @type {HTMLElement}
|
|
56
|
+
*/
|
|
57
|
+
this._editableElement = editableElement;
|
|
58
|
+
/**
|
|
59
|
+
* Whether an external {@link #_editableElement} was passed into the constructor, which also means
|
|
60
|
+
* the view will not render its {@link #template}.
|
|
61
|
+
*
|
|
62
|
+
* @private
|
|
63
|
+
* @type {Boolean}
|
|
64
|
+
*/
|
|
65
|
+
this._hasExternalElement = !!this._editableElement;
|
|
66
|
+
/**
|
|
67
|
+
* The editing view instance the editable is related to. Editable uses the editing
|
|
68
|
+
* view to dynamically modify its certain DOM attributes after {@link #render rendering}.
|
|
69
|
+
*
|
|
70
|
+
* **Note**: The DOM attributes are performed by the editing view and not UI
|
|
71
|
+
* {@link module:ui/view~View#bindTemplate template bindings} because once rendered,
|
|
72
|
+
* the editable DOM element must remain under the full control of the engine to work properly.
|
|
73
|
+
*
|
|
74
|
+
* @protected
|
|
75
|
+
* @type {module:engine/view/view~View}
|
|
76
|
+
*/
|
|
77
|
+
this._editingView = editingView;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Renders the view by either applying the {@link #template} to the existing
|
|
81
|
+
* {@link #_editableElement} or assigning {@link #element} as {@link #_editableElement}.
|
|
82
|
+
*/
|
|
83
|
+
render() {
|
|
84
|
+
super.render();
|
|
85
|
+
if (this._hasExternalElement) {
|
|
86
|
+
this.template.apply(this.element = this._editableElement);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
this._editableElement = this.element;
|
|
90
|
+
}
|
|
91
|
+
this.on('change:isFocused', () => this._updateIsFocusedClasses());
|
|
92
|
+
this._updateIsFocusedClasses();
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* @inheritDoc
|
|
96
|
+
*/
|
|
97
|
+
destroy() {
|
|
98
|
+
if (this._hasExternalElement) {
|
|
99
|
+
this.template.revert(this._editableElement);
|
|
100
|
+
}
|
|
101
|
+
super.destroy();
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Updates the `ck-focused` and `ck-blurred` CSS classes on the {@link #element} according to
|
|
105
|
+
* the {@link #isFocused} property value using the {@link #_editingView editing view} API.
|
|
106
|
+
*
|
|
107
|
+
* @private
|
|
108
|
+
*/
|
|
109
|
+
_updateIsFocusedClasses() {
|
|
110
|
+
const editingView = this._editingView;
|
|
111
|
+
if (editingView.isRenderingInProgress) {
|
|
112
|
+
updateAfterRender(this);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
update(this);
|
|
116
|
+
}
|
|
117
|
+
function update(view) {
|
|
118
|
+
editingView.change(writer => {
|
|
119
|
+
const viewRoot = editingView.document.getRoot(view.name);
|
|
120
|
+
writer.addClass(view.isFocused ? 'ck-focused' : 'ck-blurred', viewRoot);
|
|
121
|
+
writer.removeClass(view.isFocused ? 'ck-blurred' : 'ck-focused', viewRoot);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
// In a case of a multi-root editor, a callback will be attached more than once (one callback for each root).
|
|
125
|
+
// While executing one callback the `isRenderingInProgress` observable is changing what causes executing another
|
|
126
|
+
// callback and render is called inside the already pending render.
|
|
127
|
+
// We need to be sure that callback is executed only when the value has changed from `true` to `false`.
|
|
128
|
+
// See https://github.com/ckeditor/ckeditor5/issues/1676.
|
|
129
|
+
function updateAfterRender(view) {
|
|
130
|
+
editingView.once('change:isRenderingInProgress', (evt, name, value) => {
|
|
131
|
+
if (!value) {
|
|
132
|
+
update(view);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
updateAfterRender(view);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
156
140
|
}
|
|
@@ -2,67 +2,57 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* @module ui/editableui/inline/inlineeditableuiview
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
import EditableUIView from '../../editableui/editableuiview';
|
|
11
|
-
|
|
8
|
+
import EditableUIView from '../editableuiview';
|
|
12
9
|
/**
|
|
13
10
|
* The inline editable UI class implementing an inline {@link module:ui/editableui/editableuiview~EditableUIView}.
|
|
14
11
|
*
|
|
15
12
|
* @extends module:ui/editableui/editableuiview~EditableUIView
|
|
16
13
|
*/
|
|
17
14
|
export default class InlineEditableUIView extends EditableUIView {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
editingView.change( writer => {
|
|
63
|
-
const viewRoot = editingView.document.getRoot( this.name );
|
|
64
|
-
|
|
65
|
-
writer.setAttribute( 'aria-label', this._generateLabel( this ), viewRoot );
|
|
66
|
-
} );
|
|
67
|
-
}
|
|
15
|
+
/**
|
|
16
|
+
* Creates an instance of the InlineEditableUIView class.
|
|
17
|
+
*
|
|
18
|
+
* @param {module:utils/locale~Locale} [locale] The locale instance.
|
|
19
|
+
* @param {module:engine/view/view~View} editingView The editing view instance the editable is related to.
|
|
20
|
+
* @param {HTMLElement} [editableElement] The editable element. If not specified, the
|
|
21
|
+
* {@link module:ui/editableui/editableuiview~EditableUIView}
|
|
22
|
+
* will create it. Otherwise, the existing element will be used.
|
|
23
|
+
* @param {Object} [options] Additional configuration of the view.
|
|
24
|
+
* @param {Function} [options.label] A function that gets called with the instance of this view as an argument
|
|
25
|
+
* and should return a string that represents the label of the editable for assistive technologies. If not provided,
|
|
26
|
+
* a default label generator is used.
|
|
27
|
+
*/
|
|
28
|
+
constructor(locale, editingView, editableElement, options = {}) {
|
|
29
|
+
super(locale, editingView, editableElement);
|
|
30
|
+
const t = locale.t;
|
|
31
|
+
this.extendTemplate({
|
|
32
|
+
attributes: {
|
|
33
|
+
role: 'textbox',
|
|
34
|
+
class: 'ck-editor__editable_inline'
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* A function that gets called with the instance of this view as an argument and should return a string that
|
|
39
|
+
* represents the label of the editable for assistive technologies.
|
|
40
|
+
*
|
|
41
|
+
* @private
|
|
42
|
+
* @readonly
|
|
43
|
+
* @param {Function}
|
|
44
|
+
*/
|
|
45
|
+
this._generateLabel = options.label || (() => t('Editor editing area: %0', this.name));
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* @inheritDoc
|
|
49
|
+
*/
|
|
50
|
+
render() {
|
|
51
|
+
super.render();
|
|
52
|
+
const editingView = this._editingView;
|
|
53
|
+
editingView.change(writer => {
|
|
54
|
+
const viewRoot = editingView.document.getRoot(this.name);
|
|
55
|
+
writer.setAttribute('aria-label', this._generateLabel(this), viewRoot);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
68
58
|
}
|
|
@@ -2,18 +2,13 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* @module ui/editorui/bodycollection
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
8
|
/* globals document */
|
|
11
|
-
|
|
12
9
|
import Template from '../template';
|
|
13
10
|
import ViewCollection from '../viewcollection';
|
|
14
|
-
|
|
15
11
|
import createElement from '@ckeditor/ckeditor5-utils/src/dom/createelement';
|
|
16
|
-
|
|
17
12
|
/**
|
|
18
13
|
* This is a special {@link module:ui/viewcollection~ViewCollection} dedicated to elements that are detached
|
|
19
14
|
* from the DOM structure of the editor, like panels, icons, etc.
|
|
@@ -33,74 +28,65 @@ import createElement from '@ckeditor/ckeditor5-utils/src/dom/createelement';
|
|
|
33
28
|
* @extends module:ui/viewcollection~ViewCollection
|
|
34
29
|
*/
|
|
35
30
|
export default class BodyCollection extends ViewCollection {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
this._bodyCollectionContainer.remove();
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const wrapper = document.querySelector( '.ck-body-wrapper' );
|
|
101
|
-
|
|
102
|
-
if ( wrapper && wrapper.childElementCount == 0 ) {
|
|
103
|
-
wrapper.remove();
|
|
104
|
-
}
|
|
105
|
-
}
|
|
31
|
+
/**
|
|
32
|
+
* Creates a new instance of the {@link module:ui/editorui/bodycollection~BodyCollection}.
|
|
33
|
+
*
|
|
34
|
+
* @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor editor's locale} instance.
|
|
35
|
+
* @param {Iterable.<module:ui/view~View>} [initialItems] The initial items of the collection.
|
|
36
|
+
*/
|
|
37
|
+
constructor(locale, initialItems = []) {
|
|
38
|
+
super(initialItems);
|
|
39
|
+
/**
|
|
40
|
+
* The {@link module:core/editor/editor~Editor#locale editor's locale} instance.
|
|
41
|
+
* See the view {@link module:ui/view~View#locale locale} property.
|
|
42
|
+
*
|
|
43
|
+
* @member {module:utils/locale~Locale}
|
|
44
|
+
*/
|
|
45
|
+
this.locale = locale;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Attaches the body collection to the DOM body element. You need to execute this method to render the content of
|
|
49
|
+
* the body collection.
|
|
50
|
+
*/
|
|
51
|
+
attachToDom() {
|
|
52
|
+
/**
|
|
53
|
+
* The element holding elements of the body region.
|
|
54
|
+
*
|
|
55
|
+
* @protected
|
|
56
|
+
* @member {HTMLElement} #_bodyCollectionContainer
|
|
57
|
+
*/
|
|
58
|
+
this._bodyCollectionContainer = new Template({
|
|
59
|
+
tag: 'div',
|
|
60
|
+
attributes: {
|
|
61
|
+
class: [
|
|
62
|
+
'ck',
|
|
63
|
+
'ck-reset_all',
|
|
64
|
+
'ck-body',
|
|
65
|
+
'ck-rounded-corners'
|
|
66
|
+
],
|
|
67
|
+
dir: this.locale.uiLanguageDirection
|
|
68
|
+
},
|
|
69
|
+
children: this
|
|
70
|
+
}).render();
|
|
71
|
+
let wrapper = document.querySelector('.ck-body-wrapper');
|
|
72
|
+
if (!wrapper) {
|
|
73
|
+
wrapper = createElement(document, 'div', { class: 'ck-body-wrapper' });
|
|
74
|
+
document.body.appendChild(wrapper);
|
|
75
|
+
}
|
|
76
|
+
wrapper.appendChild(this._bodyCollectionContainer);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Detaches the collection from the DOM structure. Use this method when you do not need to use the body collection
|
|
80
|
+
* anymore to clean-up the DOM structure.
|
|
81
|
+
*/
|
|
82
|
+
detachFromDom() {
|
|
83
|
+
super.destroy();
|
|
84
|
+
if (this._bodyCollectionContainer) {
|
|
85
|
+
this._bodyCollectionContainer.remove();
|
|
86
|
+
}
|
|
87
|
+
const wrapper = document.querySelector('.ck-body-wrapper');
|
|
88
|
+
if (wrapper && wrapper.childElementCount == 0) {
|
|
89
|
+
wrapper.remove();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
106
92
|
}
|