浏览代码

Bound LabeledInputView#isReadOnly to the LinkCommand#isEnabled.

Oskar Wróbel 8 年之前
父节点
当前提交
7a0873fecf
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 1 1
      packages/ckeditor5-link/src/link.js
  2. 2 2
      packages/ckeditor5-link/tests/link.js

+ 1 - 1
packages/ckeditor5-link/src/link.js

@@ -93,7 +93,7 @@ export default class Link extends Plugin {
 		formView.urlInputView.bind( 'value' ).to( linkCommand, 'value' );
 
 		// Form elements should be read-only when corresponding commands are disabled.
-		formView.urlInputView.inputView.bind( 'isReadOnly' ).to( linkCommand, 'isEnabled', value => !value );
+		formView.urlInputView.bind( 'isReadOnly' ).to( linkCommand, 'isEnabled', value => !value );
 		formView.saveButtonView.bind( 'isEnabled' ).to( linkCommand );
 		formView.unlinkButtonView.bind( 'isEnabled' ).to( unlinkCommand );
 

+ 2 - 2
packages/ckeditor5-link/tests/link.js

@@ -183,7 +183,7 @@ describe( 'Link', () => {
 			editor.commands.get( 'link' ).isEnabled = true;
 			editor.commands.get( 'unlink' ).isEnabled = true;
 
-			expect( formView.urlInputView.inputView.isReadOnly ).to.false;
+			expect( formView.urlInputView.isReadOnly ).to.false;
 			expect( formView.saveButtonView.isEnabled ).to.true;
 			expect( formView.unlinkButtonView.isEnabled ).to.true;
 			expect( formView.cancelButtonView.isEnabled ).to.true;
@@ -191,7 +191,7 @@ describe( 'Link', () => {
 			editor.commands.get( 'link' ).isEnabled = false;
 			editor.commands.get( 'unlink' ).isEnabled = false;
 
-			expect( formView.urlInputView.inputView.isReadOnly ).to.true;
+			expect( formView.urlInputView.isReadOnly ).to.true;
 			expect( formView.saveButtonView.isEnabled ).to.false;
 			expect( formView.unlinkButtonView.isEnabled ).to.false;
 			expect( formView.cancelButtonView.isEnabled ).to.true;