hooch 0.16.5 → 0.16.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/hooch.js +33 -24
- data/lib/hooch/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41dd298dce03c60e49c0c5630c25ebee0db1b08a888cb04619f21e976280ff52
|
4
|
+
data.tar.gz: c72d5a6daba6dd488cf23378d350154724fc78598f197936706fd6c5da63ef70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6c38b5ef467f6f7fd7e9af133ea5b3bd79dcf36c32fb6178190c99f653731b31bfdc9c00fda41cc959155d46b74bb554e76cb3814630174270cf730032b99f3
|
7
|
+
data.tar.gz: e95556c7acc55bf843b932eb5c5e2a23deec8b2f6d4e4b10a1b7133cf979ccef395a7ddbf68a631c10fc020f2a7d03e92bb2d3b2fc43147adf020cf3b3953e5d
|
@@ -492,34 +492,43 @@ var initHooch = function(){
|
|
492
492
|
revealer.reveal();
|
493
493
|
},
|
494
494
|
reveal: function(){
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
495
|
+
if(this.revealable()){
|
496
|
+
var sanitized_value = this.getSanitizedValue();
|
497
|
+
if('true' == sanitized_value){ sanitized_value = true }
|
498
|
+
if('false' == sanitized_value){ sanitized_value = false }
|
499
|
+
this.$children = [];
|
500
|
+
var revealer = this;
|
501
|
+
this.$all_children.each(function(){
|
502
|
+
var triggers = $(this).data('revealer-triggers');
|
503
|
+
if(triggers){
|
504
|
+
trigger_prototype = typeof(triggers)
|
505
|
+
if(trigger_prototype.toLowerCase() == 'string'){
|
506
|
+
var revelation_triggers = eval('(' + triggers + ')');
|
507
|
+
} else {
|
508
|
+
revelation_triggers = triggers
|
509
|
+
}
|
510
|
+
if($.inArray(sanitized_value,revelation_triggers) > -1){
|
511
|
+
revealer.$children.push($(this));
|
512
|
+
}
|
506
513
|
} else {
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
revealer.$children.push($(this));
|
511
|
-
}
|
512
|
-
} else {
|
513
|
-
if(sanitized_value == $(this).data('revealer-trigger')){
|
514
|
-
revealer.$children.push($(this));
|
514
|
+
if(sanitized_value == $(this).data('revealer-trigger')){
|
515
|
+
revealer.$children.push($(this));
|
516
|
+
}
|
515
517
|
}
|
516
|
-
}
|
517
|
-
|
518
|
-
|
519
|
-
|
518
|
+
});
|
519
|
+
this.hideChildren();
|
520
|
+
this.revealChosenOnes();
|
521
|
+
}
|
522
|
+
},
|
523
|
+
revealable: function(){
|
524
|
+
if(this.$revealer[0].nodeName.toLowerCase() == "input" && this.$revealer.attr('type') == "radio"){
|
525
|
+
return this.$revealer.is(':checked')
|
526
|
+
} else {
|
527
|
+
return true
|
528
|
+
}
|
520
529
|
},
|
521
530
|
getSanitizedValue: function(){
|
522
|
-
if(this.$revealer[0].nodeName.toLowerCase() == "select"){
|
531
|
+
if((this.$revealer[0].nodeName.toLowerCase() == "select") || (this.$revealer[0].nodeName.toLowerCase() == "input" && this.$revealer.attr('type') == "radio")){
|
523
532
|
var sanitized_value = this.$revealer.val();
|
524
533
|
} else if(this.$revealer[0].nodeName.toLowerCase() == "input" && this.$revealer.attr('type') == "checkbox"){
|
525
534
|
var sanitized_value = this.$revealer.is(':checked');
|
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.16.
|
4
|
+
version: 0.16.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Draut
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|