lint: AttributeManager.js use ES6 method for hasAttrib

This commit is contained in:
John McLear 2021-02-17 17:25:06 +00:00
parent f86578ffc3
commit 73b3a2dc54
1 changed files with 2 additions and 1 deletions

View File

@ -406,7 +406,8 @@ AttributeManager.prototype = _(AttributeManager.prototype).extend({
hasAttrib = this.getAttributeOnSelection(attributeName);
} else {
const attributesOnCaretPosition = this.getAttributesOnCaret();
hasAttrib = _.contains(_.flatten(attributesOnCaretPosition), attributeName);
const allAttribs = [].concat(...attributesOnCaretPosition); // flatten
hasAttrib = allAttribs.includes(attributeName);
}
return hasAttrib;
},