hooch 0.12.0 → 0.13.0

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: 4219db2afe00609209fcd143a2ef9c767a4daf56
4
- data.tar.gz: 91012962eabd1a8cd051e5d51c24badef49b2e35
3
+ metadata.gz: 37724309fcde2fc0d12013d55d370e9c956a0428
4
+ data.tar.gz: 03b50dd276b60bb4d6f3726412f7405d03174bf9
5
5
  SHA512:
6
- metadata.gz: b978c49ab05b43b548566ff4fb6eeacca47b5b07b521f2abff36e694b7bc6fd4ea8d770b328eeb846b6221882678286bc0593d7ceffce91edebbcb73280fe096
7
- data.tar.gz: b353eab5ce5cbf82b4b9ba6ea3f6c05d73c73061f37b5535f079bcbf045fb382e7da895c4e86bf61601fbcdcb789d93fd38399bec8b1bc4fe15dfe7eb23fa6f1
6
+ metadata.gz: 15dd6af2ee95aa3233dcde52ef0860cc68c23f70346820dc13bc80c97f6e7f2a432a46c45635222917b707c010cffbcc378ff51884981492bf0dcab0e3c19257
7
+ data.tar.gz: 1d06de7c07c7e93833e6774f083aaba19efe8178ae6ac580afbebcf475336db685aa46b240f6e95c09377c5f3483372fec67503a1d0691738fe19ba5753746f9
@@ -18,6 +18,15 @@ var initHooch = function(){
18
18
  this.targets.filter('[data-toggle_value="' + this.value + '"]').show();
19
19
  }
20
20
  }),
21
+ HideShow: Class.extend({
22
+ init: function($trigger){
23
+ this.$target = $($trigger.data('target'))
24
+ var trigger = this
25
+ $trigger.on('click', function(){
26
+ trigger.$target.toggle()
27
+ })
28
+ }
29
+ }),
21
30
  HoverOverflow: Class.extend({
22
31
  init: function(jq_obj){
23
32
  this.old_border = jq_obj.css('border-right');
@@ -1587,7 +1596,7 @@ var initHooch = function(){
1587
1596
  'expand-state' : 'Expandable', 'prevent-double-click' : 'PreventDoubleLinkClick'
1588
1597
  },'hooch');
1589
1598
  window.any_time_manager.registerList(
1590
- ['hover_overflow','hidey_button','submit-proxy','click-proxy','field-filler','revealer',
1599
+ ['hover_overflow','hidey_button','hide-show','submit-proxy','click-proxy','field-filler','revealer',
1591
1600
  'checkbox-hidden-proxy','prevent-double-submit','prevent-double-link-click', 'tab-group',
1592
1601
  'hover-reveal', 'emptier', 'remover', 'checkbox-proxy', 'fake-select', 'select-action-changer',
1593
1602
  'sorter','bind-key','modal-trigger','history-pusher', 'history-replacer'],'hooch');
@@ -29,6 +29,18 @@ module Hooch
29
29
  attrs += " data-content-target=\"#{target}\""
30
30
  end
31
31
 
32
+ def hide_show(target)
33
+ {}.tap do |params|
34
+ params['data-hide-show'] = true
35
+ params['data-target'] = target
36
+ end
37
+ end
38
+
39
+ def hide_show_attrs(target)
40
+ attrs = "data-hide-show=true data-target=" + target
41
+ attrs
42
+ end
43
+
32
44
  def expander(id, expand_class: nil, collapse_class: nil)
33
45
  attrs = "data-expander=true data-expand-id=" + id
34
46
  attrs += " data-expand-class=" + expand_class if expand_class.present?
data/lib/hooch/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hooch
2
- VERSION = "0.12.0"
2
+ VERSION = "0.13.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hooch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Draut
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-23 00:00:00.000000000 Z
11
+ date: 2016-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails