8
0
Просмотр исходного кода

Merge pull request #67 from ckeditor/t/65b

t/65b: Saving the new url does not update the link in editable.
Oskar Wróbel 9 лет назад
Родитель
Сommit
13a0a85888
2 измененных файлов с 5 добавлено и 2 удалено
  1. 1 1
      packages/ckeditor5-link/src/link.js
  2. 4 1
      packages/ckeditor5-link/tests/link.js

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

@@ -197,7 +197,7 @@ export default class Link extends Feature {
 
 		// Execute link command after clicking on formView `Save` button.
 		this.listenTo( formView, 'submit', () => {
-			editor.execute( 'link', formView.urlInputView.value );
+			editor.execute( 'link', formView.urlInputView.inputView.element.value );
 			this._hidePanel( true );
 		} );
 

+ 4 - 1
packages/ckeditor5-link/tests/link.js

@@ -367,7 +367,10 @@ describe( 'Link', () => {
 			it( 'should execute link command on formView#submit event', () => {
 				const executeSpy = testUtils.sinon.spy( editor, 'execute' );
 
-				formView.urlInputView.value = 'http://cksource.com';
+				formView.urlInputView.value = 'http://ckeditor.com';
+				expect( formView.urlInputView.inputView.element.value ).to.equal( 'http://ckeditor.com' );
+
+				formView.urlInputView.inputView.element.value = 'http://cksource.com';
 				formView.fire( 'submit' );
 
 				expect( executeSpy.calledOnce ).to.true;