accessible-bootstrap3-rails 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d9f27ed83fd1de5de31898aea710770c6e05ff16
4
- data.tar.gz: 285ee593cce03f96ded91978c1a2ac3697d1dcf8
3
+ metadata.gz: 7abef6946bcbc639c138bac9433a055159080b7b
4
+ data.tar.gz: a98acd8bd62cb63560bc3d4292defe6afba9b62b
5
5
  SHA512:
6
- metadata.gz: 22d970101d8c5edb75372c4cf1f311a721031f348984c973927afc629aed1dd34a3d60eea26e983e5892fa329e4044007e04f9d782bd9547712409fa95fc4081
7
- data.tar.gz: 65b0508c2b93fe0c747844190ae1022fa96ce03276f28c0078cb9bca6f7fb05b98a74bc0ba2eb2a2a1131cec43e4d2515ce7a1ce04d4863091f81b97c9ecb42d
6
+ metadata.gz: 1b4a513ddf86c4e003acf50ca626971eead4a71ab5ab7d048d16f57ad902924509640d4c383f771e6055d2ac2b0c0bcaa4f49f4696dcc8158e7342be821733ca
7
+ data.tar.gz: e338cc40281a1cfa11385d3105415084e7fa919c4148eb2affd8c652be90c624aeb7e40e3d89edb79d4fc1fffcdf17102ec05e387e191a3bd7d47deb1e4e7418
data/README.md CHANGED
@@ -93,6 +93,7 @@ This Package tries to address accessibility related issues mostly related to key
93
93
  > 1. We start off making sure drop-downs and sub-menus get closed when they lose focus.
94
94
  > 2. We update area-expanded attributes accordingly when drop-downs are opened and closed.
95
95
  > * Make sure you start off by adding are-expanded="false" to all .dropdown-toggle .trigger class elements.
96
+ > 3. We automatically add attributes like role=menu to any .dropdown-menu or .dropdown-submenu menus. We also set aria-haspopup="true" and tabindex="0" on any a.trigger a.dropdown-toggle links.
96
97
  > 3. We add the ability to open and close menus with the space-bar.
97
98
  > 4. We also prevent the enter key from submitting forms except when on the form submit button. When enter is pressed on
98
99
  > a text input it will place focus on the next input. When it is pressed on a checkbox or radio button it will toggle
@@ -13,14 +13,14 @@
13
13
  ]
14
14
  ],
15
15
  "_from": "accessible-bootstrap3@latest",
16
- "_id": "accessible-bootstrap3@0.2.1",
16
+ "_id": "accessible-bootstrap3@0.2.2",
17
17
  "_inCache": true,
18
18
  "_installable": true,
19
19
  "_location": "/accessible-bootstrap3",
20
20
  "_nodeVersion": "5.10.0",
21
21
  "_npmOperationalInternal": {
22
- "host": "packages-16-east.internal.npmjs.com",
23
- "tmp": "tmp/accessible-bootstrap3-0.2.1.tgz_1466032393512_0.889837101334706"
22
+ "host": "packages-12-west.internal.npmjs.com",
23
+ "tmp": "tmp/accessible-bootstrap3-0.2.2.tgz_1466094775595_0.39899865607731044"
24
24
  },
25
25
  "_npmUser": {
26
26
  "email": "the-team@reax.io",
@@ -39,8 +39,8 @@
39
39
  "_requiredBy": [
40
40
  "/"
41
41
  ],
42
- "_resolved": "https://registry.npmjs.org/accessible-bootstrap3/-/accessible-bootstrap3-0.2.1.tgz",
43
- "_shasum": "f195bb19caaef05a5bc5f7bd4880aef7b79e7309",
42
+ "_resolved": "https://registry.npmjs.org/accessible-bootstrap3/-/accessible-bootstrap3-0.2.2.tgz",
43
+ "_shasum": "fc1de88da1349a2c2adfcc008ce6b79f2e922b2e",
44
44
  "_shrinkwrap": null,
45
45
  "_spec": "accessible-bootstrap3@latest",
46
46
  "_where": "/Users/brandonhoward/Desktop/code/reax_code/accessible-bootstrap3-rails",
@@ -59,13 +59,13 @@
59
59
  "devDependencies": {},
60
60
  "directories": {},
61
61
  "dist": {
62
- "shasum": "f195bb19caaef05a5bc5f7bd4880aef7b79e7309",
63
- "tarball": "https://registry.npmjs.org/accessible-bootstrap3/-/accessible-bootstrap3-0.2.1.tgz"
62
+ "shasum": "fc1de88da1349a2c2adfcc008ce6b79f2e922b2e",
63
+ "tarball": "https://registry.npmjs.org/accessible-bootstrap3/-/accessible-bootstrap3-0.2.2.tgz"
64
64
  },
65
65
  "engines": {
66
66
  "node": ">=4.2.4"
67
67
  },
68
- "gitHead": "576c3bfb98126d10d695fe1560c08ca12c564d7d",
68
+ "gitHead": "7e03b9094528b8b7b04ce3cc1c9552b70d0edb2c",
69
69
  "homepage": "https://github.com/ReaxDev/accessible-bootstrap3#readme",
70
70
  "license": "MIT",
71
71
  "main": "index.js",
@@ -89,5 +89,5 @@
89
89
  "scripts": {
90
90
  "test": "echo \"Error: no test specified\" && exit 1"
91
91
  },
92
- "version": "0.2.1"
92
+ "version": "0.2.2"
93
93
  }
data/package.json CHANGED
@@ -9,6 +9,6 @@
9
9
  "author": "Brandon Howard <brandon@reax.io> (brandonrhoward.com)",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "accessible-bootstrap3": "0.2.1"
12
+ "accessible-bootstrap3": "0.2.2"
13
13
  }
14
14
  }
@@ -7,9 +7,14 @@ $(document).ready(function() {
7
7
  return event.keyCode || event.which;
8
8
  }
9
9
 
10
- ///// Make sure all submenu links are focusable
11
- $(".trigger").each(function() {
10
+ // Make sure all submenu links are focusable
11
+ $(".trigger, .dropdown-toggle").each(function() {
12
12
  $(this).attr("tabindex", 0);
13
+ $(this).attr("aria-haspopup", true)
14
+ });
15
+ // properly label menu's
16
+ $(".dropdown-menu, .dropdown-submenu").each(function() {
17
+ $(this).attr("role", "menu");
13
18
  });
14
19
  //////////////////////////////////////////////////////////////////
15
20
  // This code removes the open class from a .dropdown menu,
@@ -80,12 +85,13 @@ $(document).ready(function() {
80
85
  }
81
86
  });
82
87
 
83
- $('.dropdown-submenu a.trigger').keydown(function(event) {
88
+ $('.dropdown-submenu a.trigger').on('keydown click', function(event) {
84
89
  var code = getKeyCode(event);
85
90
  var subMenu = $(this).next("ul.sub-menu");
86
91
 
87
- if (code === 32 ) {
92
+ if (code === 32 || code === 1 || code == 13) {
88
93
  // Stop page scroll
94
+ event.stopPropagation();
89
95
  event.preventDefault();
90
96
  // Open and close submenu when space bar is hit.
91
97
  subMenu.css('display') == "none" ? subMenu.css('display', 'block' ) : subMenu.css('display', 'none' )
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: accessible-bootstrap3-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - brayhoward
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-15 00:00:00.000000000 Z
11
+ date: 2016-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler