cd2_tabs 0.2.0 → 0.2.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: 1df111b6813a8d39b86a6fae2e92100a24e36225
4
- data.tar.gz: 1896654a027fa86d7d9d46c62db0312ea8c5dfdb
3
+ metadata.gz: 758dd47d6312c7fea53920a804283e1e01134c9f
4
+ data.tar.gz: e3ccc21084a7fbc98253c004cd605d735c17f3e7
5
5
  SHA512:
6
- metadata.gz: 375bf93f023377e235370f38badb651d28c0c2f2684d7d9407093c3acf2e44cbb0f09a5e156c1d51f253e8f99270011dcb5f4896ea058adf9dddfa60f640194a
7
- data.tar.gz: 885f75e6cf0ad9b463b4a034ab57d050f3a71d0e99e881ee35f00b04ceb68d30229ace4ae66250601d78804551e069d650158b680a3c711e25c2d8522f2f8dd0
6
+ metadata.gz: c2d52ebaf511b74ae0c9b6506e45a9b7d3905042713caa1c8373c13b5aa6b43c51a0eb3487f36321abf52384ff69aee0fb3f3dd43079dc0f2b0adaa58090dcf3
7
+ data.tar.gz: 00cd09c0bddb72d84a60c149aa14d00ea3c771b59fa449ab20b925a17fcd5a5a524471835e60833122157819eeeacfa15ca2fb33a9a667e9d8985126469ecca8
@@ -1,25 +1,36 @@
1
1
  //= require jscookie
2
2
 
3
- $(function (){
4
- var cookieName = "tab_" + window.location.pathname;
5
- var cookieTab = Cookies.get(cookieName);
3
+ $(function() {
4
+ var cookieName = "tab_" + window.location.pathname;
5
+ var cookieTab = Cookies.get(cookieName);
6
6
 
7
- if ( typeof cookieTab !== 'undefined' && cookieTab.length > 0 ) {
7
+ if (typeof cookieTab !== 'undefined' && cookieTab.length > 0) {
8
8
 
9
- // Switching tabs on ajax load & switch tab on page load
10
- $( document ).ajaxComplete(function( event, request, settings ) {
11
- $(".tabs_container input[value='"+cookieTab+"']").prop( "checked", true );
12
- });
9
+ // Switching tabs on ajax load & switch tab on page load
10
+ $(document).ajaxComplete(function(event, request, settings) {
11
+ $(".tabs_container input[value='" + cookieTab + "']").prop("checked", true);
12
+ });
13
+
14
+ $(".tabs_container input[value='" + cookieTab + "']").prop("checked", true);
13
15
 
14
- $(".tabs_container input[value='"+cookieTab+"']").prop( "checked", true );
16
+ }
15
17
 
16
- }
18
+ // Setting on load
19
+ if ($('.tabs_container:first-of-type > .tab_controller')[0] != $('.tabs_container:first-of-type > .tab_controller:checked').get()[0]) {
20
+
21
+ Cookies.set(cookieName, $('.tabs_container:first-of-type > .tab_controller:checked').attr('value'), {
22
+ expires: 0.01
23
+ });
17
24
 
18
- // Delegated event listener for tab heads for when ajax loading
19
- $("body").on("click", ".tab_heads_container label", function(){
25
+ }
20
26
 
21
- Cookies.set(cookieName, $(this).attr('class'), { expires: 0.01 });
27
+ // Delegated event listener for tab heads for when ajax loading
28
+ $("body").on("click", ".tab_heads_container label", function() {
22
29
 
23
- })
30
+ Cookies.set(cookieName, $(this).attr('class'), {
31
+ expires: 0.01
32
+ });
33
+
34
+ });
24
35
 
25
36
  })
@@ -1,3 +1,3 @@
1
1
  module Cd2Tabs
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cd2_tabs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - CD2
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-16 00:00:00.000000000 Z
11
+ date: 2017-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails