From 73b3a2dc54bc5b85ec06069e2b1aebd02b3ef1ec Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 17 Feb 2021 17:25:06 +0000 Subject: [PATCH] lint: AttributeManager.js use ES6 method for hasAttrib --- src/static/js/AttributeManager.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/static/js/AttributeManager.js b/src/static/js/AttributeManager.js index 19424b0a7..7a37c8ffc 100644 --- a/src/static/js/AttributeManager.js +++ b/src/static/js/AttributeManager.js @@ -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; },