浏览代码

Merge branch 'master' into t/ckeditor5/479

Aleksander Nowodzinski 6 年之前
父节点
当前提交
d80d974fd9

+ 8 - 4
packages/ckeditor5-ui/package.json

@@ -35,7 +35,7 @@
     "del": "^2.2.0",
     "eslint": "^5.5.0",
     "eslint-config-ckeditor5": "^1.0.9",
-    "husky": "^0.14.3",
+    "husky": "^1.3.1",
     "lint-staged": "^7.0.0",
     "lodash-cli": "^4"
   },
@@ -57,8 +57,7 @@
     "theme"
   ],
   "scripts": {
-    "lint": "eslint --quiet '**/*.js'",
-    "precommit": "lint-staged"
+    "lint": "eslint --quiet '**/*.js'"
   },
   "lint-staged": {
     "**/*.js": [
@@ -68,5 +67,10 @@
   "eslintIgnore": [
     "src/lib/**",
     "packages/**"
-  ]
+  ],
+  "husky": {
+    "hooks": {
+      "pre-commit": "lint-staged"
+    }
+  }
 }

+ 2 - 2
packages/ckeditor5-ui/tests/manual/tickets/170/1.js

@@ -28,7 +28,7 @@ ClassicEditor
 
 		panel.attachTo( {
 			target: editor.ui.view.element.querySelector( '.ck-editor__editable p strong' ),
-			limiter: editor.ui.view.editableElement
+			limiter: editor.ui.getEditableElement()
 		} );
 
 		window.attachEditor = editor;
@@ -53,7 +53,7 @@ ClassicEditor
 
 		panel.pin( {
 			target: editor.ui.view.element.querySelector( '.ck-editor__editable p strong' ),
-			limiter: editor.ui.view.editableElement
+			limiter: editor.ui.getEditableElement()
 		} );
 
 		window.stickEditor = editor;

+ 1 - 1
packages/ckeditor5-ui/tests/toolbar/balloon/balloontoolbar.js

@@ -147,7 +147,7 @@ describe( 'BalloonToolbar', () => {
 		it( 'it should track the focus of the #editableElement', () => {
 			expect( balloonToolbar.focusTracker.isFocused ).to.false;
 
-			editor.ui.view.editableElement.dispatchEvent( new Event( 'focus' ) );
+			editor.ui.getEditableElement().dispatchEvent( new Event( 'focus' ) );
 
 			expect( balloonToolbar.focusTracker.isFocused ).to.true;
 		} );

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

@@ -179,7 +179,7 @@ describe( 'BlockToolbar', () => {
 				expect( blockToolbar.panelView.isVisible ).to.be.true;
 				sinon.assert.calledWith( pinSpy, {
 					target: blockToolbar.buttonView.element,
-					limiter: editor.ui.view.editableElement
+					limiter: editor.ui.getEditableElement()
 				} );
 				sinon.assert.calledOnce( focusSpy );
 			} );
@@ -279,7 +279,7 @@ describe( 'BlockToolbar', () => {
 			'of the selected block #1', () => {
 			setData( editor.model, '<paragraph>foo[]bar</paragraph>' );
 
-			const target = editor.ui.view.editableElement.querySelector( 'p' );
+			const target = editor.ui.getEditableElement().querySelector( 'p' );
 			const styleMock = testUtils.sinon.stub( window, 'getComputedStyle' );
 
 			styleMock.withArgs( target ).returns( {
@@ -289,7 +289,7 @@ describe( 'BlockToolbar', () => {
 
 			styleMock.callThrough();
 
-			testUtils.sinon.stub( editor.ui.view.editableElement, 'getBoundingClientRect' ).returns( {
+			testUtils.sinon.stub( editor.ui.getEditableElement(), 'getBoundingClientRect' ).returns( {
 				left: 200
 			} );
 
@@ -313,7 +313,7 @@ describe( 'BlockToolbar', () => {
 			'of the selected block #2', () => {
 			setData( editor.model, '<paragraph>foo[]bar</paragraph>' );
 
-			const target = editor.ui.view.editableElement.querySelector( 'p' );
+			const target = editor.ui.getEditableElement().querySelector( 'p' );
 			const styleMock = testUtils.sinon.stub( window, 'getComputedStyle' );
 
 			styleMock.withArgs( target ).returns( {
@@ -324,7 +324,7 @@ describe( 'BlockToolbar', () => {
 
 			styleMock.callThrough();
 
-			testUtils.sinon.stub( editor.ui.view.editableElement, 'getBoundingClientRect' ).returns( {
+			testUtils.sinon.stub( editor.ui.getEditableElement(), 'getBoundingClientRect' ).returns( {
 				left: 200
 			} );
 
@@ -359,7 +359,7 @@ describe( 'BlockToolbar', () => {
 
 			sinon.assert.calledWith( spy, {
 				target: blockToolbar.buttonView.element,
-				limiter: editor.ui.view.editableElement
+				limiter: editor.ui.getEditableElement()
 			} );
 		} );