hooch 0.13.0 → 0.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/hooch.js +10 -1
- data/lib/hooch/hooch_helper.rb +4 -2
- data/lib/hooch/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f76e60f68ad16df45e9c59fece26a363dc1f01be
|
4
|
+
data.tar.gz: c4078fc5c1990d32b6eb4f249a684a8069df80cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f27c044997f7b4ca1c4cf58c9ff699e52545fbc6a05370cf87d22b31ce651538d866b8d2af9fedf793c3c01b88b4974c404812cd55f21217c8702e9fccbd75bb
|
7
|
+
data.tar.gz: 980199ded9a0bc8e204de78c78b8129e5d5d12573e56fed8df05e9cbbfb530cf74f225267c8039a7a446e3866993a3f168e3fe64b536b754798e607cf204bdb5
|
@@ -22,8 +22,17 @@ var initHooch = function(){
|
|
22
22
|
init: function($trigger){
|
23
23
|
this.$target = $($trigger.data('target'))
|
24
24
|
var trigger = this
|
25
|
-
$trigger.
|
25
|
+
if($trigger.data('any-click-closes')){
|
26
|
+
$(window).on('click',function(){
|
27
|
+
if(trigger.$target.is(':visible')){
|
28
|
+
trigger.$target.hide()
|
29
|
+
}
|
30
|
+
})
|
31
|
+
}
|
32
|
+
$trigger.on('click', function(e){
|
26
33
|
trigger.$target.toggle()
|
34
|
+
e.preventDefault()
|
35
|
+
return false
|
27
36
|
})
|
28
37
|
}
|
29
38
|
}),
|
data/lib/hooch/hooch_helper.rb
CHANGED
@@ -29,15 +29,17 @@ module Hooch
|
|
29
29
|
attrs += " data-content-target=\"#{target}\""
|
30
30
|
end
|
31
31
|
|
32
|
-
def hide_show(target)
|
32
|
+
def hide_show(target, any_click_closes: false)
|
33
33
|
{}.tap do |params|
|
34
34
|
params['data-hide-show'] = true
|
35
35
|
params['data-target'] = target
|
36
|
+
params['data-any-click-closes'] = true if any_click_closes
|
36
37
|
end
|
37
38
|
end
|
38
39
|
|
39
|
-
def hide_show_attrs(target)
|
40
|
+
def hide_show_attrs(target, any_click_closes: false)
|
40
41
|
attrs = "data-hide-show=true data-target=" + target
|
42
|
+
attrs += " data-any-click-closes=true" if any_click_closes
|
41
43
|
attrs
|
42
44
|
end
|
43
45
|
|
data/lib/hooch/version.rb
CHANGED
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.13.
|
4
|
+
version: 0.13.1
|
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-
|
11
|
+
date: 2016-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|