Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <markdotto@gmail.com>2018-01-12 09:42:40 +0300
committerMark Otto <markdotto@gmail.com>2018-01-12 09:42:40 +0300
commit6d8d8639f3a290cba93ef406c59ea31ad46e1c6d (patch)
treeafef6ae26f246839effeb0fe894bab25075c7418 /js/dist/collapse.js
parent80d0943b95984bfaf4997d2198d467876d294bd8 (diff)
dist
Diffstat (limited to 'js/dist/collapse.js')
-rw-r--r--js/dist/collapse.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/js/dist/collapse.js b/js/dist/collapse.js
index 03093983e3..e2e26e6aca 100644
--- a/js/dist/collapse.js
+++ b/js/dist/collapse.js
@@ -89,12 +89,12 @@ var Collapse = function ($) {
if (this._config.toggle) {
this.toggle();
}
- } // getters
+ } // Getters
var _proto = Collapse.prototype;
- // public
+ // Public
_proto.toggle = function toggle() {
if ($(this._element).hasClass(ClassName.SHOW)) {
this.hide();
@@ -116,7 +116,7 @@ var Collapse = function ($) {
if (this._parent) {
actives = $.makeArray($(this._parent).find(Selector.ACTIVES).filter("[data-parent=\"" + this._config.parent + "\"]"));
- if (!actives.length) {
+ if (actives.length === 0) {
actives = null;
}
}
@@ -149,7 +149,7 @@ var Collapse = function ($) {
$(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
this._element.style[dimension] = 0;
- if (this._triggerArray.length) {
+ if (this._triggerArray.length > 0) {
$(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
}
@@ -195,7 +195,7 @@ var Collapse = function ($) {
Util.reflow(this._element);
$(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW);
- if (this._triggerArray.length) {
+ if (this._triggerArray.length > 0) {
for (var i = 0; i < this._triggerArray.length; i++) {
var trigger = this._triggerArray[i];
var selector = Util.getSelectorFromElement(trigger);
@@ -239,12 +239,12 @@ var Collapse = function ($) {
this._element = null;
this._triggerArray = null;
this._isTransitioning = null;
- }; // private
+ }; // Private
_proto._getConfig = function _getConfig(config) {
config = _extends({}, Default, config);
- config.toggle = Boolean(config.toggle); // coerce string values
+ config.toggle = Boolean(config.toggle); // Coerce string values
Util.typeCheckConfig(NAME, config, DefaultType);
return config;
@@ -261,7 +261,7 @@ var Collapse = function ($) {
var parent = null;
if (Util.isElement(this._config.parent)) {
- parent = this._config.parent; // it's a jQuery object
+ parent = this._config.parent; // It's a jQuery object
if (typeof this._config.parent.jquery !== 'undefined') {
parent = this._config.parent[0];
@@ -281,11 +281,11 @@ var Collapse = function ($) {
if (element) {
var isOpen = $(element).hasClass(ClassName.SHOW);
- if (triggerArray.length) {
+ if (triggerArray.length > 0) {
$(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
}
}
- }; // static
+ }; // Static
Collapse._getTargetFromElement = function _getTargetFromElement(element) {
@@ -311,7 +311,7 @@ var Collapse = function ($) {
if (typeof config === 'string') {
if (typeof data[config] === 'undefined') {
- throw new Error("No method named \"" + config + "\"");
+ throw new TypeError("No method named \"" + config + "\"");
}
data[config]();