From 9b8356ba52d89fd065d6061979b5946b8c5f44fa Mon Sep 17 00:00:00 2001 From: Johann-S Date: Mon, 25 Sep 2017 12:41:54 +0200 Subject: Collapse - Allow to pass jQuery object or DOM element to the parent option --- js/src/util.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'js/src/util.js') diff --git a/js/src/util.js b/js/src/util.js index b18d0f776..7eb25de55 100644 --- a/js/src/util.js +++ b/js/src/util.js @@ -32,10 +32,6 @@ const Util = (() => { return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase() } - function isElement(obj) { - return (obj[0] || obj).nodeType - } - function getSpecialTransitionEndEvent() { return { bindType: transition.end, @@ -138,12 +134,16 @@ const Util = (() => { return Boolean(transition) }, + isElement(obj) { + return (obj[0] || obj).nodeType + }, + typeCheckConfig(componentName, config, configTypes) { for (const property in configTypes) { if (Object.prototype.hasOwnProperty.call(configTypes, property)) { const expectedTypes = configTypes[property] const value = config[property] - const valueType = value && isElement(value) ? + const valueType = value && Util.isElement(value) ? 'element' : toType(value) if (!new RegExp(expectedTypes).test(valueType)) { -- cgit v1.2.3