8
0
Pārlūkot izejas kodu

Changed BlockToolbar horizontal position.

Oskar Wróbel 7 gadi atpakaļ
vecāks
revīzija
f56bc13601

+ 1 - 1
packages/ckeditor5-ui/src/toolbar/block/blocktoolbar.js

@@ -315,7 +315,7 @@ export default class BlockToolbar extends Plugin {
 				( contentRect, buttonRect ) => {
 					return {
 						top: contentRect.top + contentPaddingTop + ( ( contentLineHeight - buttonRect.height ) / 2 ),
-						left: editableRect.left
+						left: editableRect.left - buttonRect.width
 					};
 				}
 			]

+ 2 - 2
packages/ckeditor5-ui/tests/toolbar/block/blocktoolbar.js

@@ -266,7 +266,7 @@ describe( 'BlockToolbar', () => {
 			styleMock.callThrough();
 
 			testUtils.sinon.stub( editor.ui.view.editableElement, 'getBoundingClientRect' ).returns( {
-				left: 100
+				left: 200
 			} );
 
 			testUtils.sinon.stub( target, 'getBoundingClientRect' ).returns( {
@@ -300,7 +300,7 @@ describe( 'BlockToolbar', () => {
 			styleMock.callThrough();
 
 			testUtils.sinon.stub( editor.ui.view.editableElement, 'getBoundingClientRect' ).returns( {
-				left: 100
+				left: 200
 			} );
 
 			testUtils.sinon.stub( target, 'getBoundingClientRect' ).returns( {