From 35f80bb12e4e71fd777ee60ffa43711d8f84b1a6 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 10 Aug 2017 20:56:35 -0700 Subject: bump to beta --- js/src/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/src/util.js') diff --git a/js/src/util.js b/js/src/util.js index 3c0d02251..387c7d2ed 100644 --- a/js/src/util.js +++ b/js/src/util.js @@ -1,6 +1,6 @@ /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-alpha.6): util.js + * Bootstrap (v4.0.0-beta): util.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ -- cgit v1.2.3 From ef8c77d8dcebd13559a141e419d003c2d10cc5f3 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 27 Jul 2017 13:39:55 +0300 Subject: Tweak ESLint rules. --- js/src/util.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/src/util.js') diff --git a/js/src/util.js b/js/src/util.js index 387c7d2ed..69fb8283c 100644 --- a/js/src/util.js +++ b/js/src/util.js @@ -42,7 +42,7 @@ const Util = (($) => { if ($(event.target).is(this)) { return event.handleObj.handler.apply(this, arguments) // eslint-disable-line prefer-rest-params } - return undefined + return undefined // eslint-disable-line no-undefined } } } @@ -55,7 +55,7 @@ const Util = (($) => { const el = document.createElement('bootstrap') for (const name in TransitionEndEvent) { - if (el.style[name] !== undefined) { + if (typeof el.style[name] !== 'undefined') { return { end: TransitionEndEvent[name] } @@ -138,7 +138,7 @@ const Util = (($) => { typeCheckConfig(componentName, config, configTypes) { for (const property in configTypes) { - if (configTypes.hasOwnProperty(property)) { + if (Object.prototype.hasOwnProperty.call(configTypes, property)) { const expectedTypes = configTypes[property] const value = config[property] const valueType = value && isElement(value) ? -- cgit v1.2.3 From bcad4bcb5f5a9ef079b2883a48a698b35261e083 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Fri, 25 Aug 2017 21:54:49 +0200 Subject: Fix XSS in data-target --- js/src/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/src/util.js') diff --git a/js/src/util.js b/js/src/util.js index 69fb8283c..cd3f1fb6a 100644 --- a/js/src/util.js +++ b/js/src/util.js @@ -117,7 +117,7 @@ const Util = (($) => { } try { - const $selector = $(selector) + const $selector = $(document).find(selector) return $selector.length > 0 ? selector : null } catch (error) { return null -- cgit v1.2.3 From 9936bf59444c402b653f28449529eab83794e911 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Tue, 29 Aug 2017 21:16:00 +0200 Subject: Create a bundled release of Bootstrap with Popper.js inside --- js/src/util.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'js/src/util.js') diff --git a/js/src/util.js b/js/src/util.js index cd3f1fb6a..b18d0f776 100644 --- a/js/src/util.js +++ b/js/src/util.js @@ -1,3 +1,5 @@ +import $ from 'jquery' + /** * -------------------------------------------------------------------------- * Bootstrap (v4.0.0-beta): util.js @@ -5,7 +7,7 @@ * -------------------------------------------------------------------------- */ -const Util = (($) => { +const Util = (() => { /** -- cgit v1.2.3 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 From b29b1e155880ac953899889c9cbb67f7f7df0529 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Tue, 3 Oct 2017 14:27:36 +0200 Subject: Use imported jQuery object --- js/src/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/src/util.js') diff --git a/js/src/util.js b/js/src/util.js index 7eb25de55..a75660014 100644 --- a/js/src/util.js +++ b/js/src/util.js @@ -161,6 +161,6 @@ const Util = (() => { return Util -})(jQuery) +})($) export default Util -- cgit v1.2.3