dta_rapid 1.6.0 → 1.6.1

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: a082ea2966c9804a0b2157e8cb17e11a0f3f457d
4
- data.tar.gz: 1c76deb977af53e1925ae8cd0d73cb044715fde7
3
+ metadata.gz: 839d22b607f67127fbcafed91295f5cbea8bc1dc
4
+ data.tar.gz: b10bebddde4467f4c0e3f23e29761270347fc6af
5
5
  SHA512:
6
- metadata.gz: c96f1448fe1334b8f4c385f6d256c7ded1e35202da7f7e76c2f574064142d7227a3313d1378887acf5d701586658c2167d4fbef9305320b985069e1c4e0f33ec
7
- data.tar.gz: 6c2db8e1d85d49904764b0de88725866e6171af5785cfcb01778fb624470e946eda9ab583f8debcb2ba7320914042118f16837ea36da05938af6bb618f8724c4
6
+ metadata.gz: 48efc3177531f35be20d53acfb86f506af16fac1e438a60a7b40a258f98273ad423a37e94f5f8a5ef0e7a09d7377caa944762a88c17d52c85dd2c80d7c63d378
7
+ data.tar.gz: b1c76d79bad1f6ddc34b499c056bc5f759d8da318b386072a8cf1c3b7c1952b220a70028fce29eaf21eb89c88c580737d7865b2bee15713e0716facdcc5fc3c8
@@ -54,13 +54,20 @@
54
54
  limit: 5,
55
55
  templates: {
56
56
  suggestion: function(result) {
57
- return `<div role="option" aria-selected="false" class="suggestion-search__item"><a class="suggestion-search__link" href="${result.link}">${result.shortDescription}</a></div>`;
57
+ var onclick = result.login ? "event.preventDefault();" : " ";
58
+ return `<div role="option" aria-selected="false" class="suggestion-search__item">
59
+ <a onclick="${onclick}" class="suggestion-search__link" href="${result.link}">${result.shortDescription}</a></div>`;
58
60
  },
59
61
  }
60
62
  });
61
63
 
62
64
  $('.suggestion-search__input').bind('typeahead:select', function(e, suggestion) {
63
- window.location.href = suggestion.link;
65
+ var loggedOut = localStorage.getItem('loggedIn') !== 'true';
66
+ if (suggestion.login && loggedOut) {
67
+ window.location.href = "/account_login.html"
68
+ } else {
69
+ window.location.href = suggestion.link;
70
+ }
64
71
  });
65
72
  });
66
73
  </script>
@@ -17,7 +17,7 @@
17
17
  </g>
18
18
  </svg>
19
19
  </a>
20
- <div class="col-xs-7 col-sm-9 col-md-10" style="padding-top: 0.5em; padding-bottom: 0.5em; text-align: right;"><a class="js-log-in" href="/my-account.html">Log in</a></div>
20
+ <div class="col-xs-7 col-sm-9 col-md-10" style="padding-top: 0.5em; padding-bottom: 0.5em; text-align: right;"><a class="js-log-in" href="/my-account.html">My Account</a></div>
21
21
  </div>
22
22
  </div>
23
23
  </header>
@@ -1,8 +1,7 @@
1
+
1
2
  $(function () {
2
- $('.js-log-in').text(localStorage.getItem('loggedIn') ? "My Account" : "Log in");
3
3
 
4
- $('.js-log-in').on('click', function (event) {
5
- event.preventDefault();
4
+ var _logMeIn = function () {
6
5
  var loggedIn = localStorage.getItem('loggedIn') === "true";
7
6
 
8
7
  if (!loggedIn) {
@@ -10,6 +9,12 @@ $(function () {
10
9
  } else {
11
10
  window.location.href = "/my-account.html"
12
11
  }
12
+ }
13
+
14
+ $('.js-log-in').on('click', function (event) {
15
+ event.preventDefault();
16
+ _logMeIn();
13
17
  });
18
+
14
19
  });
15
20
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dta_rapid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gareth Rogers