Преглед изворни кода

Added the .ck-reset_all class to the toolbar.

Piotrek Koszuliński пре 7 година
родитељ
комит
c45a4703c9

+ 8 - 0
packages/ckeditor5-editor-decoupled/src/decouplededitoruiview.js

@@ -10,6 +10,7 @@
 import EditorUIView from '@ckeditor/ckeditor5-ui/src/editorui/editoruiview';
 import InlineEditableUIView from '@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview';
 import ToolbarView from '@ckeditor/ckeditor5-ui/src/toolbar/toolbarview';
+import Template from '@ckeditor/ckeditor5-ui/src/template';
 
 import '../theme/decouplededitor.css';
 
@@ -49,6 +50,13 @@ export default class DecoupledEditorUIView extends EditorUIView {
 		 * @member {module:ui/editableui/inline/inlineeditableuiview~InlineEditableUIView}
 		 */
 		this.editable = new InlineEditableUIView( locale );
+
+		// This toolbar may be placed anywhere in the page so things like font-size needs to be reset in it.
+		Template.extend( this.toolbar.template, {
+			attributes: {
+				class: 'ck-reset_all'
+			}
+		} );
 	}
 
 	/**

+ 4 - 0
packages/ckeditor5-editor-decoupled/tests/decouplededitoruiview.js

@@ -42,6 +42,10 @@ describe( 'DecoupledEditorUIView', () => {
 				expect( view.isRendered ).to.be.true;
 				expect( view.toolbar.element.parentElement ).to.be.null;
 			} );
+
+			it( 'gets the .ck-reset_all class', () => {
+				expect( view.toolbar.element.classList.contains( 'ck-reset_all' ) ).to.be.true;
+			} );
 		} );
 
 		describe( '#editable', () => {

+ 2 - 2
packages/ckeditor5-editor-decoupled/tests/manual/decouplededitor.html

@@ -4,10 +4,10 @@
 </p>
 
 <h2>The toolbar</h2>
-<div class="toolbar-container ck-reset_all"></div>
+<div class="toolbar-container"></div>
 
 <h2>The editable</h2>
-<div class="editable-container ck-reset "></div>
+<div class="editable-container"></div>
 
 <style>
 	.editable-container,