hootstrap 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/javascripts/hootstrap/collapse.js +32 -0
- data/assets/javascripts/hootstrap.js +1 -0
- data/lib/hootstrap/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bd309254f4d0275a81d1c6025585304ba8a9911c35e71f4548bbf96155dd546
|
4
|
+
data.tar.gz: 7fde0f64dd95cf5d34cba80cd9d515ac1762585b900d8b3c70279bcc420ac3e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e7646fafd4561533060abe84929751f514bba9f254134aa17d153c1472bf7c17366f0e846fa10c0f02362fece08ffaa24b3132a4d2a782e1ee932689ebf1de9
|
7
|
+
data.tar.gz: 54510fb7d565815697e25e9edb9cc99618900b172634d6300f773d6229b4ea8619d6a9a1d352f517739343030253c43b5162640dc6ddfa06746fe613b54cf21b
|
@@ -0,0 +1,32 @@
|
|
1
|
+
//= require ./utils/dynamicListener
|
2
|
+
|
3
|
+
document.addEventListener(Hootstrap.turbolinks.event, () => {
|
4
|
+
addDynamicEventListener(
|
5
|
+
document.body,
|
6
|
+
'click',
|
7
|
+
'[data-toggle="collapse"]',
|
8
|
+
toggleCollapse
|
9
|
+
);
|
10
|
+
|
11
|
+
document.body.addEventListener('click', event => {
|
12
|
+
if (event.target.parentElement.dataset.toggle === "collapse") {
|
13
|
+
event.preventDefault();
|
14
|
+
event.target.parentElement.click();
|
15
|
+
}
|
16
|
+
});
|
17
|
+
|
18
|
+
function toggleCollapse(event) {
|
19
|
+
event.preventDefault();
|
20
|
+
|
21
|
+
const button = event.target;
|
22
|
+
const target = document.querySelector(button.dataset.target)
|
23
|
+
|
24
|
+
if (target.classList && target.classList.contains('show')) {
|
25
|
+
target.classList.remove('show');
|
26
|
+
target.setAttribute('aria-expanded', 'false');
|
27
|
+
} else {
|
28
|
+
target.classList.add('show');
|
29
|
+
target.setAttribute('aria-expanded', 'true');
|
30
|
+
}
|
31
|
+
}
|
32
|
+
});
|
data/lib/hootstrap/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Licata
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -64,6 +64,7 @@ files:
|
|
64
64
|
- Rakefile
|
65
65
|
- assets/javascripts/hootstrap.js
|
66
66
|
- assets/javascripts/hootstrap/alerts.js
|
67
|
+
- assets/javascripts/hootstrap/collapse.js
|
67
68
|
- assets/javascripts/hootstrap/dropdown.js
|
68
69
|
- assets/javascripts/hootstrap/modal.js
|
69
70
|
- assets/javascripts/hootstrap/rails.js
|