gintonic-rails 0.3.1 → 0.3.2

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: 5b68a8f308a19a3cbda38f9b1d72b08df3a86a5c
4
- data.tar.gz: f0772b299ee4ec46bdf7bedc6581119281e240a6
3
+ metadata.gz: 1cfc18c9a1c5fe6ce29cd8f6cfd652fc77f57d52
4
+ data.tar.gz: 380dd3c1f178d4a7dde6567e9033dffef02c4e7a
5
5
  SHA512:
6
- metadata.gz: d72e64ffc0585609dbca086213994bab947f7e76ad8a4dcd78acaad66429a4c1ce100cd778d9a2656a333418781a6566845cc0050d920c9bba01a760806a1fea
7
- data.tar.gz: bc9e12f92457315506150bc4ad841d686bfd8696bcb38f0d7864971eda7da810625f7d69c88416721a5578795fab73eddf2dc08b5d7ae37062d8253f8ec38d42
6
+ metadata.gz: 6f87be70cfa57c0ce6adcb3b8427f1e3d6171602110a517c2b896adfbd68bca50389cc679896b6f4ecb383b998a4f6ad6c929a97f3b3237e15c6c635df17ab20
7
+ data.tar.gz: 3523e0b6e481a8befa94b5919e96d2630577b7e80ce9404e46832c23fbe17e53434dc72c7d965bce13549ef2bf5b5457b753e3630b232a51b638707ef53cfc8b
@@ -1,2 +1,3 @@
1
1
  //=require mqbe
2
2
  //=require gintonic/simple_events
3
+ //=require gintonic/g_tabs
@@ -0,0 +1,55 @@
1
+ (function($) {
2
+
3
+ $.gTabs = function(el) {
4
+ var plugin = this,
5
+ $el = $(el);
6
+
7
+ this.$el = $el;
8
+
9
+ $el.data('g-tabs', plugin);
10
+
11
+
12
+ plugin.init = function() {
13
+ var $active_el = $el.find('.g-tab-nav.active');
14
+
15
+ if ($active_el.length === 1) {
16
+ plugin.activate_tab($active_el);
17
+ } else {
18
+ plugin.activate_tag($el.find('.g-tab-nav').first());
19
+ }
20
+
21
+ $el.on('click', '.g-tab-nav', function() {
22
+ plugin.activate_tab($(this));
23
+ });
24
+ };
25
+
26
+ plugin.activate_tab = function($nav) {
27
+ var $target = (typeof $nav.attr('data-g-tab') !== 'undefined') ? $($nav.attr('data-g-tab')) : $($nav.attr('href')),
28
+ $fk_selects = $target.find('.has-fk-select');
29
+
30
+ // Activate nav
31
+ $nav.addClass('active')
32
+ .siblings('.g-tab-nav').removeClass('active');
33
+
34
+ // Activate element
35
+ $target.addClass('active')
36
+ .siblings('.g-tab').removeClass('active');
37
+
38
+ if ($fk_selects.length > 0) {
39
+ $fk_selects.each(function() {
40
+ formikation.updateSelectWH($(this));
41
+ });
42
+ }
43
+ };
44
+
45
+ plugin.init();
46
+ };
47
+
48
+
49
+
50
+ $.fn.gTabs = function(options) {
51
+ return this.each(function() {
52
+ (new $.gTabs(this));
53
+ });
54
+ };
55
+ })(jQuery);
@@ -11,3 +11,4 @@
11
11
 
12
12
  @import "gintonic/modules/buttons";
13
13
  @import "gintonic/modules/responsive_helpers";
14
+ @import "gintonic/modules/g_tabs";
@@ -0,0 +1,6 @@
1
+ .g-tab {
2
+ display: none;
3
+ &.active {
4
+ display: block;
5
+ }
6
+ }
@@ -1,3 +1,3 @@
1
1
  module Gintonic
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gintonic-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simplelogica
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-08-09 00:00:00.000000000 Z
12
+ date: 2016-08-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sass
@@ -110,11 +110,13 @@ files:
110
110
  - README.md
111
111
  - Rakefile
112
112
  - app/assets/javascripts/gintonic.js
113
+ - app/assets/javascripts/gintonic/g_tabs.js
113
114
  - app/assets/javascripts/gintonic/simple_events.js
114
115
  - app/assets/stylesheets/_gintonic.scss
115
116
  - app/assets/stylesheets/gintonic/base/_utils.scss
116
117
  - app/assets/stylesheets/gintonic/base/_vars.scss
117
118
  - app/assets/stylesheets/gintonic/modules/_buttons.scss
119
+ - app/assets/stylesheets/gintonic/modules/_g_tabs.scss
118
120
  - app/assets/stylesheets/gintonic/modules/_responsive_helpers.scss
119
121
  - gintonic-rails.gemspec
120
122
  - lib/generators/gintonic/js/USAGE