diff --git a/src/model/element.js b/src/model/element.js index cff992681..a3ef2974d 100644 --- a/src/model/element.js +++ b/src/model/element.js @@ -113,7 +113,8 @@ export default class Element extends Node { * @returns {Boolean} */ is( type, name = null ) { - const cutType = type.replace( 'model:', '' ); + const cutType = type.replace( /^model:/, '' ); + if ( !name ) { return cutType == 'element' || cutType == this.name || super.is( type ); } else { diff --git a/src/view/attributeelement.js b/src/view/attributeelement.js index ef74cedba..9fa77c815 100644 --- a/src/view/attributeelement.js +++ b/src/view/attributeelement.js @@ -128,7 +128,8 @@ export default class AttributeElement extends Element { * @inheritDoc */ is( type, name = null ) { - const cutType = type && type.replace( 'view:', '' ); + const cutType = type && type.replace( /^view:/, '' ); + if ( !name ) { return cutType == 'attributeElement' || super.is( type ); } else {