assets/javascripts/bootstrap.js in bootstrap-4.0.0.alpha1 vs assets/javascripts/bootstrap.js in bootstrap-4.0.0.alpha2

- old
+ new

@@ -8,12 +8,12 @@ throw new Error('Bootstrap\'s JavaScript requires jQuery') } +function ($) { var version = $.fn.jquery.split(' ')[0].split('.') - if (version[0] !== '2') { - throw new Error('Bootstrap\'s JavaScript requires jQuery version 2.x.x') + if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] >= 3)) { + throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v3.0.0') } }(jQuery); +function ($) { @@ -1784,11 +1784,11 @@ $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, $.proxy(this.hide, this)); $(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () { $(_this7._element).one(Event.MOUSEUP_DISMISS, function (event) { if ($(event.target).is(_this7._element)) { - that._ignoreBackdropClick = true; + _this7._ignoreBackdropClick = true; } }); }); this._showBackdrop($.proxy(this._showElement, this, relatedTarget)); @@ -2751,20 +2751,30 @@ }; return Tab; })(jQuery); +/* global Tether */ + /** * -------------------------------------------------------------------------- * Bootstrap (v4.0.0): tooltip.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ var Tooltip = (function ($) { /** + * Check for Tether dependency + * Tether - http://github.hubspot.com/tether/ + */ + if (window.Tether === undefined) { + throw new Error('Bootstrap tooltips require Tether (http://github.hubspot.com/tether/)'); + } + + /** * ------------------------------------------------------------------------ * Constants * ------------------------------------------------------------------------ */ @@ -2995,11 +3005,12 @@ element: tip, target: this.element, classes: TetherClass, classPrefix: CLASS_PREFIX, offset: this.config.offset, - constraints: this.config.constraints + constraints: this.config.constraints, + addTargetClasses: false }); Util.reflow(tip); this._tether.position(); @@ -3117,16 +3128,10 @@ }, { key: 'cleanupTether', value: function cleanupTether() { if (this._tether) { this._tether.destroy(); - - // clean up after tether's junk classes - // remove after they fix issue - // (https://github.com/HubSpot/tether/issues/36) - $(this.element).removeClass(this._removeTetherClasses); - $(this.tip).removeClass(this._removeTetherClasses); } } // private @@ -3159,14 +3164,9 @@ selector: '' }); } else { this._fixTitle(); } - } - }, { - key: '_removeTetherClasses', - value: function _removeTetherClasses(i, css) { - return ((css.baseVal || css).match(new RegExp('(^|\\s)' + CLASS_PREFIX + '-\\S+', 'g')) || []).join(' '); } }, { key: '_fixTitle', value: function _fixTitle() { var titleType = typeof this.element.getAttribute('data-original-title');