Sfoglia il codice sorgente

Use Node.is() to check for element type.

Maciej 5 anni fa
parent
commit
32ed8f052d
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      packages/ckeditor5-link/src/linkcommand.js

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

@@ -62,7 +62,7 @@ export default class LinkCommand extends Command {
 
 
 		// A check for the `LinkImage` plugin. If the selection contains an element, get values from the element.
 		// A check for the `LinkImage` plugin. If the selection contains an element, get values from the element.
 		// Currently the selection reads attributes from text nodes only. See #7429.
 		// Currently the selection reads attributes from text nodes only. See #7429.
-		if ( selectedElement && selectedElement.name === 'image' ) {
+		if ( selectedElement && selectedElement.is( 'image' ) ) {
 			this.value = selectedElement.getAttribute( 'linkHref' );
 			this.value = selectedElement.getAttribute( 'linkHref' );
 			this.isEnabled = model.schema.checkAttribute( selectedElement, 'linkHref' );
 			this.isEnabled = model.schema.checkAttribute( selectedElement, 'linkHref' );
 		} else {
 		} else {