Skip to content

Commit fe21f84

Browse files
committed
Deuglified toolbar creation - now only first fired uiSpace will generate toolbar.
1 parent f82844b commit fe21f84

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

core/creators/themedui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ CKEDITOR.replaceClass = 'ckeditor';
302302

303303
// Get the HTML for the predefined spaces.
304304
var topHtml = editor.fire( 'uiSpace', { space: 'top', html: '' } ).html;
305-
var bottomHtml = editor.fireOnce( 'uiSpace', { space: 'bottom', html: '' } ).html;
305+
var bottomHtml = editor.fire( 'uiSpace', { space: 'bottom', html: '' } ).html;
306306

307307
if ( !themedTpl ) {
308308
themedTpl = CKEDITOR.addTemplate( 'maincontainer', '<{outerEl}' +

plugins/floatingspace/plugin.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020

2121
CKEDITOR.plugins.add( 'floatingspace', {
2222
init: function( editor ) {
23-
editor.on( 'contentDom', function() {
23+
// Add listener with lower priority than that in themedui creator.
24+
// Thereby floatingspace will be created only if themedui wasn't used.
25+
editor.on( 'loaded', function() {
2426
attach( editor );
25-
});
27+
}, null, null, 20 );
2628
}
2729
});
2830

plugins/toolbar/plugin.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@
149149

150150
editor.on( 'uiSpace', function( event ) {
151151
if ( event.data.space == editor.config.toolbarLocation ) {
152+
// Create toolbar only once.
153+
event.removeListener();
154+
152155
editor.toolbox = new toolbox();
153156

154157
var labelId = CKEDITOR.tools.getNextId();

0 commit comments

Comments
 (0)