--- a/dist/owl.carousel.js +++ b/dist/owl.carousel.js @@ -1014,4 +1014,4 @@ Owl.prototype.invalidate = function(part) { - if ($.type(part) === 'string') { + if (typeof part === 'string') { this._invalidated[part] = true; this.is('valid') && this.leave('valid'); @@ -1539,6 +1539,12 @@ /** * Triggers a public event. + * jQuery 4.0 removed $.camelCase(); use a local replacement. + */ + function owlCamelCase(str) { + return str.replace(/-([a-z])/g, function(_, letter) { return letter.toUpperCase(); }); + } + /** * @todo Remove `status`, `relatedTarget` should be used instead. * @protected * @param {String} name - The event name. @@ -1552,7 +1558,7 @@ Owl.prototype.trigger = function(name, data, namespace, state, enter) { var status = { item: { count: this._items.length, index: this.current() } - }, handler = $.camelCase( + }, handler = owlCamelCase( $.grep([ 'on', name, namespace ], function(v) { return v }) .join('-').toLowerCase() ), event = $.Event(