From 3642c140438dff4facae5a7e2ceb931e659c7f3a Mon Sep 17 00:00:00 2001 From: hates Date: Wed, 18 Oct 2017 11:31:50 +0300 Subject: [PATCH] dont override real jquery --- src/utils/extender.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/utils/extender.js b/src/utils/extender.js index 45e05908e7..f9d3146193 100644 --- a/src/utils/extender.js +++ b/src/utils/extender.js @@ -51,7 +51,7 @@ module.exports = ({$, Backbone}) => { }; } - if ($) { + if ($ && $.prototype.constructor.name !== 'jQuery') { const fn = $.fn; const splitNamespace = function(name) { @@ -293,8 +293,10 @@ module.exports = ({$, Backbone}) => { return ar; } - $.inArray = function(val, arr) { - return arr.indexOf(val); + const indexOf = Array.prototype.indexOf; + + $.inArray = function(val, arr, i) { + return arr == null ? -1 : indexOf.call( arr, val, i ); } $.Event = function(src, props) {