1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-08 22:56:46 +02:00
This commit is contained in:
XhmikosR
2019-08-27 16:03:21 +03:00
committed by GitHub
parent cad3d1098a
commit bf57274fb5
59 changed files with 1686 additions and 2107 deletions

48
js/dist/button.js vendored
View File

@@ -35,8 +35,17 @@
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
var _window = window,
jQuery = _window.jQuery; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
var getjQuery = function getjQuery() {
var _window = window,
jQuery = _window.jQuery;
if (jQuery && !document.body.hasAttribute('data-no-jquery')) {
return jQuery;
}
return null;
};
/**
* ------------------------------------------------------------------------
@@ -93,16 +102,14 @@
if (rootElement) {
var input = SelectorEngine.findOne(Selector.INPUT, this._element);
if (input) {
if (input.type === 'radio') {
if (input.checked && this._element.classList.contains(ClassName.ACTIVE)) {
triggerChangeEvent = false;
} else {
var activeElement = SelectorEngine.findOne(Selector.ACTIVE, rootElement);
if (input && input.type === 'radio') {
if (input.checked && this._element.classList.contains(ClassName.ACTIVE)) {
triggerChangeEvent = false;
} else {
var activeElement = SelectorEngine.findOne(Selector.ACTIVE, rootElement);
if (activeElement) {
activeElement.classList.remove(ClassName.ACTIVE);
}
if (activeElement) {
activeElement.classList.remove(ClassName.ACTIVE);
}
}
@@ -135,7 +142,7 @@
} // Static
;
Button._jQueryInterface = function _jQueryInterface(config) {
Button.jQueryInterface = function jQueryInterface(config) {
return this.each(function () {
var data = Data.getData(this, DATA_KEY);
@@ -149,7 +156,7 @@
});
};
Button._getInstance = function _getInstance(element) {
Button.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY);
};
@@ -199,6 +206,7 @@
button.classList.remove(ClassName.FOCUS);
}
});
var $ = getjQuery();
/**
* ------------------------------------------------------------------------
* jQuery
@@ -208,14 +216,14 @@
/* istanbul ignore if */
if (typeof jQuery !== 'undefined') {
var JQUERY_NO_CONFLICT = jQuery.fn[NAME];
jQuery.fn[NAME] = Button._jQueryInterface;
jQuery.fn[NAME].Constructor = Button;
if ($) {
var JQUERY_NO_CONFLICT = $.fn[NAME];
$.fn[NAME] = Button.jQueryInterface;
$.fn[NAME].Constructor = Button;
jQuery.fn[NAME].noConflict = function () {
jQuery.fn[NAME] = JQUERY_NO_CONFLICT;
return Button._jQueryInterface;
$.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT;
return Button.jQueryInterface;
};
}