Преглед на файлове

Changed BlockToolbar horizontal position.

Oskar Wróbel преди 7 години
родител
ревизия
f56bc13601
променени са 2 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 1 1
      packages/ckeditor5-ui/src/toolbar/block/blocktoolbar.js
  2. 2 2
      packages/ckeditor5-ui/tests/toolbar/block/blocktoolbar.js

+ 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( {