Skip to content

Commit

Permalink
Attempting to fix #122
Browse files Browse the repository at this point in the history
  • Loading branch information
thednp committed Mar 21, 2017
1 parent 4171f48 commit f888c54
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 20 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap.native",
"version": "2.0.7",
"version": "2.0.8",
"homepage": "http://thednp.github.io/bootstrap.native/",
"authors": [
"dnp_theme"
Expand Down
17 changes: 12 additions & 5 deletions dist/bootstrap-native-v4.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Native Javascript for Bootstrap 4 v2.0.6 | © dnp_theme | MIT-License
// Native Javascript for Bootstrap 4 v2.0.8 | © dnp_theme | MIT-License
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD support:
Expand Down Expand Up @@ -737,9 +737,16 @@
removeClass(element,collapsed);

if ( accordion !== null ) {
var activeCollapses = getElementsByClassName(accordion,component+' '+showClass);
var activeCollapses = getElementsByClassName(accordion,component+' '+showClass),
allToggles = accordion.querySelectorAll('['+dataToggle+'="'+component+'"]'),
correspondingCollapse;
for (var i=0, al=activeCollapses[length]; i<al; i++) {
if ( activeCollapses[i] !== collapse) closeAction(activeCollapses[i]);
if ( activeCollapses[i] !== collapse ) { closeAction(activeCollapses[i]); }
}
for (var u=0, atl=allToggles[length]; u<atl; u++) {
correspondingCollapse = allToggles[u][getAttribute][dataTarget] || allToggles[u].href;
if ( correspondingCollapse.split('#')[1] !== collapse.id ) { addClass(allToggles[u],collapsed); }
else { removeClass(allToggles[u],collapsed); }
}
}
};
Expand Down Expand Up @@ -1500,8 +1507,8 @@
element = queryElement(element);

// DATA API
var animationData = element[getAttribute](dataAnimation);
placementData = element[getAttribute](dataPlacement);
var animationData = element[getAttribute](dataAnimation),
placementData = element[getAttribute](dataPlacement),
delayData = element[getAttribute](dataDelay),
containerData = element[getAttribute](dataContainer),

Expand Down
4 changes: 2 additions & 2 deletions dist/bootstrap-native-v4.min.js

Large diffs are not rendered by default.

15 changes: 11 additions & 4 deletions dist/bootstrap-native.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Native Javascript for Bootstrap 3 v2.0.7 | © dnp_theme | MIT-License
// Native Javascript for Bootstrap 3 v2.0.8 | © dnp_theme | MIT-License
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD support:
Expand Down Expand Up @@ -823,7 +823,7 @@


// event targets and constants
var accordion = null, collapse = null, self = this,
var accordion = null, collapse = null, self = this,
isAnimating = false, // when true it will prevent click handlers
accordionData = element[getAttribute]('data-parent'),

Expand Down Expand Up @@ -894,9 +894,16 @@
removeClass(element,collapsed);

if ( accordion !== null ) {
var activeCollapses = getElementsByClassName(accordion,component+' '+inClass);
var activeCollapses = getElementsByClassName(accordion,component+' '+inClass),
allToggles = accordion[querySelectorAll]('['+dataToggle+'="'+component+'"]'),
correspondingCollapse;
for (var i=0, al=activeCollapses[length]; i<al; i++) {
if ( activeCollapses[i] !== collapse) closeAction(activeCollapses[i]);
if ( activeCollapses[i] !== collapse ) { closeAction(activeCollapses[i]); }
}
for (var u=0, atl=allToggles[length]; u<atl; u++) {
correspondingCollapse = allToggles[u][getAttribute][dataTarget] || allToggles[u].href;
if ( correspondingCollapse.split('#')[1] !== collapse.id ) { addClass(allToggles[u],collapsed); }
else { removeClass(allToggles[u],collapsed); }
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions dist/bootstrap-native.min.js

Large diffs are not rendered by default.

13 changes: 10 additions & 3 deletions lib/V3/collapse-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var Collapse = function( element, options ) {


// event targets and constants
var accordion = null, collapse = null, self = this,
var accordion = null, collapse = null, self = this,
isAnimating = false, // when true it will prevent click handlers
accordionData = element[getAttribute]('data-parent'),

Expand Down Expand Up @@ -85,9 +85,16 @@ var Collapse = function( element, options ) {
removeClass(element,collapsed);

if ( accordion !== null ) {
var activeCollapses = getElementsByClassName(accordion,component+' '+inClass);
var activeCollapses = getElementsByClassName(accordion,component+' '+inClass),
allToggles = accordion[querySelectorAll]('['+dataToggle+'="'+component+'"]'),
correspondingCollapse;
for (var i=0, al=activeCollapses[length]; i<al; i++) {
if ( activeCollapses[i] !== collapse) closeAction(activeCollapses[i]);
if ( activeCollapses[i] !== collapse ) { closeAction(activeCollapses[i]); }
}
for (var u=0, atl=allToggles[length]; u<atl; u++) {
correspondingCollapse = allToggles[u][getAttribute][dataTarget] || allToggles[u].href;
if ( correspondingCollapse.split('#')[1] !== collapse.id ) { addClass(allToggles[u],collapsed); }
else { removeClass(allToggles[u],collapsed); }
}
}
};
Expand Down
11 changes: 9 additions & 2 deletions lib/V4/collapse-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,16 @@ var Collapse = function( element, options ) {
removeClass(element,collapsed);

if ( accordion !== null ) {
var activeCollapses = getElementsByClassName(accordion,component+' '+showClass);
var activeCollapses = getElementsByClassName(accordion,component+' '+showClass),
allToggles = accordion.querySelectorAll('['+dataToggle+'="'+component+'"]'),
correspondingCollapse;
for (var i=0, al=activeCollapses[length]; i<al; i++) {
if ( activeCollapses[i] !== collapse) closeAction(activeCollapses[i]);
if ( activeCollapses[i] !== collapse ) { closeAction(activeCollapses[i]); }
}
for (var u=0, atl=allToggles[length]; u<atl; u++) {
correspondingCollapse = allToggles[u][getAttribute][dataTarget] || allToggles[u].href;
if ( correspondingCollapse.split('#')[1] !== collapse.id ) { addClass(allToggles[u],collapsed); }
else { removeClass(allToggles[u],collapsed); }
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap.native",
"version": "2.0.7",
"version": "2.0.8",
"description": "Native Javascript for Bootstrap, the sweetest Javascript library without jQuery.",
"main": "dist/bootstrap-native.js",
"scripts": {
Expand Down

0 comments on commit f888c54

Please sign in to comment.