middleman-hashicorp 0.3.17 → 0.3.18

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
  SHA1:
3
- metadata.gz: f29065cffd44f1591c6d75114ba15f9a30a144e4
4
- data.tar.gz: 7ee8489e9caac475044485f4c813c1db62b50be1
3
+ metadata.gz: ce3284876fcd013172f2b3ee5e62c8e84eddf9f4
4
+ data.tar.gz: 4b19c1be5a46960207172f12e3c6b70ffa3d395c
5
5
  SHA512:
6
- metadata.gz: ad55eb15aaa61dd235beb2c0023d2517c8d83f417a97beb68617519f3b3bd96978d1972d9e29486c5e0a3e3def0a49f33f00cf6285bb8782be392e48d1a44dc1
7
- data.tar.gz: 820a106f2a9203604d1ea9757b74d6aca40de88edd0766e461c8f21e602e12f969100819823c4fbd339e32c15b167ab0bd9049f872fe7c75deabef0f30e75ac5
6
+ metadata.gz: d22dc6551ad7316f1b9a2ce5c030a9ef2489bade9f5484bee7ed6b7933727f980e6efe61e78b2d901697badb8856e2522e574925cb5959f6c189913035a95d3d
7
+ data.tar.gz: 6126066e64f55ab476ecff3a4b7342bcd9f42c3c19202123923419a22d9bba113cb2b5d157efc8da87b658b9408b1027cad2cc098b3b872ad566d5d34e8a7f29
@@ -21,56 +21,50 @@ var HashiMegaNav = function() {
21
21
  }
22
22
  }
23
23
 
24
- var dropDownBreakpoint = window.matchMedia("(min-width: 980px)");
24
+ var $body = $('#mega-nav-body-ct');
25
+ var $arrow = $('#mega-nav-ctrl');
26
+ var $nav = $arrow.parent();
27
+ var $close = $('#mega-nav-close');
25
28
 
26
- function megaNavModal() {
27
- $('#mega-nav-body-ct').attr({
28
- role: 'dialog',
29
- tabindex: -1
30
- });
31
-
32
- $('#mega-nav-ctrl').on('click.megaNav', function(){
33
- $('#mega-nav-body-ct').modal({
34
- backdrop: false
35
- });
36
- });
37
-
38
- $('#mega-nav-close').on('click.megaNav', function() {
39
- $('#mega-nav-body-ct').modal('hide');
40
- });
29
+ function matchesBreakpoint() {
30
+ return window.matchMedia("(min-width: 980px)").matches;
41
31
  }
42
32
 
43
- function megaNavModalDestroy() {
44
- $('#mega-nav-ctrl').off('click.megaNav');
45
- $('#mega-nav-close').off('click.megaNav');
46
- $('#mega-nav-body-ct')
47
- .modal('hide')
48
- .removeAttr('role tabindex style')
49
- .data('bs.modal', null);
33
+ function openNav() {
34
+ if(matchesBreakpoint()) {
35
+ $body.slideDown('fast');
36
+ $nav.addClass('open');
37
+ } else {
38
+ $body.fadeIn('fast');
39
+ }
50
40
  }
51
41
 
52
- function megaNavDropDown() {
53
- $('#mega-nav-ctrl').attr('data-toggle', 'dropdown');
42
+ function closeNav() {
43
+ if(matchesBreakpoint()) {
44
+ $body.slideUp('fast');
45
+ $nav.removeClass('open');
46
+ } else {
47
+ $body.fadeOut('fast');
48
+ }
54
49
  }
55
50
 
56
- function megaNavDropDownDestroy() {
57
- $('#mega-nav-ctrl').parent().removeClass('open');
58
- $('#mega-nav-ctrl').removeAttr('data-toggle aria-expanded');
59
- $('#mega-nav-body-ct').removeAttr('aria-labelledby');
51
+ function isNavOpen() {
52
+ return $nav.hasClass('open');
60
53
  }
61
54
 
62
- function handleDropDownBreakpoint(breakpoint) {
63
- if (breakpoint.matches) {
64
- megaNavModalDestroy();
65
- megaNavDropDown();
55
+ $arrow.unbind().on('click', function(e) {
56
+ e.preventDefault(); // Don't jump page to "#"
57
+
58
+ if(isNavOpen()) {
59
+ closeNav();
66
60
  } else {
67
- megaNavDropDownDestroy();
68
- megaNavModal();
61
+ openNav();
69
62
  }
70
- }
63
+ });
71
64
 
72
- dropDownBreakpoint.addListener(handleDropDownBreakpoint);
73
- handleDropDownBreakpoint(dropDownBreakpoint);
65
+ $close.unbind().on('click', function() {
66
+ closeNav();
67
+ });
74
68
  }
75
69
 
76
70
  // Handle document ready function and the turbolinks load.
@@ -18,12 +18,12 @@ var HashiSidebar = function() {
18
18
 
19
19
  // Hide the sidebar when the user clicks on the overlay. The overlay is
20
20
  // only "clickable" when it's active.
21
- $overlay.on('click', function(e){
21
+ $overlay.unbind().on('click', function(e){
22
22
  hideSidebar();
23
23
  });
24
24
 
25
25
  // Show the sidebar when the user clicks the hamburger menu.
26
- $toggle.on('click', function(e) {
26
+ $toggle.unbind().on('click', function(e) {
27
27
  e.preventDefault(); // Don't jump page to "#"
28
28
 
29
29
  // Only activate the sidebar if it's not already active. Since these
@@ -272,6 +272,11 @@ $mega-nav-sandbox-specificity: 4;
272
272
  &:hover,
273
273
  &:focus {
274
274
  color: tint($mega-nav-color-black, 20);
275
+ outline: none;
276
+ }
277
+
278
+ &:active {
279
+ outline: none;
275
280
  }
276
281
  }
277
282
 
@@ -144,8 +144,11 @@ class Middleman::HashiCorpExtension < ::Middleman::Extension
144
144
  #
145
145
  # @return [String] (html)
146
146
  #
147
- def system_icon(name)
148
- image_tag("icons/icon_#{name.to_s.downcase}.png")
147
+ def system_icon(name, options = {})
148
+ image_tag("icons/icon_#{name.to_s.downcase}.png", {
149
+ height: 75,
150
+ width: 75,
151
+ }.merge(options))
149
152
  end
150
153
 
151
154
  #
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module HashiCorp
3
- VERSION = "0.3.17"
3
+ VERSION = "0.3.18"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-hashicorp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.17
4
+ version: 0.3.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Vargo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-24 00:00:00.000000000 Z
11
+ date: 2017-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  version: '0'
239
239
  requirements: []
240
240
  rubyforge_project:
241
- rubygems_version: 2.6.8
241
+ rubygems_version: 2.5.2
242
242
  signing_key:
243
243
  specification_version: 4
244
244
  summary: A series of helpers for consistency among HashiCorp's middleman sites