app/assets/javascripts/hooch.js in hooch-0.13.1 vs app/assets/javascripts/hooch.js in hooch-0.13.2
- old
+ new
@@ -18,22 +18,21 @@
this.targets.filter('[data-toggle_value="' + this.value + '"]').show();
}
}),
HideShow: Class.extend({
init: function($trigger){
+ this.$trigger = $trigger
this.$target = $($trigger.data('target'))
var trigger = this
if($trigger.data('any-click-closes')){
- $(window).on('click',function(){
- if(trigger.$target.is(':visible')){
+ $(window).on('click',function(e){
+ if(trigger.$target.is(':visible') && ($(e.target).data('target') != trigger.$trigger.data('target'))){
trigger.$target.hide()
}
})
}
$trigger.on('click', function(e){
trigger.$target.toggle()
- e.preventDefault()
- return false
})
}
}),
HoverOverflow: Class.extend({
init: function(jq_obj){