소스 검색

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