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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5276c288b04cc5d5e4f7bc7e7ca5abae4748db5db90b01861ba6a76b9ce25769
4
- data.tar.gz: 435b7e344a52a5f635e8349437d36840b488e6964db2f05fa434fca376df2898
3
+ metadata.gz: 2bd309254f4d0275a81d1c6025585304ba8a9911c35e71f4548bbf96155dd546
4
+ data.tar.gz: 7fde0f64dd95cf5d34cba80cd9d515ac1762585b900d8b3c70279bcc420ac3e6
5
5
  SHA512:
6
- metadata.gz: d81eb6f0e3f88402c993dd73a3a10cf6585ebbd6a90961818e762db19fd937285788ea26af664ad5917851258fb92dcfcdced82bd3f5b1a946e12bbf5a5c767c
7
- data.tar.gz: 41dffe5bd0e277f2b25f434b9b140b1830903b89bb604aedf9c078bacc326e1efe93b8de2863a2e2e7aa57dc17897f16f883f780a57a8852a091d3201ab6a9a8
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
+ });
@@ -1,5 +1,6 @@
1
1
  //= require hootstrap/utils/turbolinks
2
2
  //= require hootstrap/alerts
3
+ //= require hootstrap/collapse
3
4
  //= require hootstrap/dropdown
4
5
  //= require hootstrap/modal
5
6
  //= require hootstrap/rails
@@ -1,3 +1,3 @@
1
1
  module Hootstrap
2
- VERSION = '0.7.0'
2
+ VERSION = '0.8.0'
3
3
  end
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.7.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-08-29 00:00:00.000000000 Z
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