app/assets/javascripts/hooch.js in hooch-0.10.2 vs app/assets/javascripts/hooch.js in hooch-0.10.3
- old
+ new
@@ -150,11 +150,11 @@
},
getContentWrapper: function(){
this.$modal_content_wrapper = this.$modal_element.find('#hooch-content')
var content_height = this.modal_height - (this.padding*2)
this.$modal_content_wrapper.css({'overflow-y': 'scroll', 'max-height': content_height, position: 'relative', float: 'left'})
- this.$modal_content_wrapper.html(this.$modal_content)
+ this.$modal_content_wrapper.html(this.$modal_content)
},
getDismisser: function(){
this.$dismisser = this.$modal_mask.find('#hooch-dismiss')
this.$dismisser.css({position: 'relative', float: 'right', 'font-size': '22px', 'line-height': '30px'})
this.dismisser = new hooch.ModalDismisser(this.$dismisser,this)
@@ -191,14 +191,14 @@
$('body').css({height: this.old_height, overflow: this.old_overflow})
$('body').off('.hoochModalScroll')
if (window.removeEventListener){
window.removeEventListener('DOMMouseScroll', hooch.preventDefault, false);
}
- window.onmousewheel = document.onmousewheel = null;
- window.onwheel = null;
- window.ontouchmove = null;
- document.onkeydown = null;
+ window.onmousewheel = document.onmousewheel = null;
+ window.onwheel = null;
+ window.ontouchmove = null;
+ document.onkeydown = null;
}
}),
Expandable: Class.extend({
init: function($expandable){
var expandable = this;
@@ -1280,11 +1280,11 @@
},
preventDefault: function(e) {
e = e || window.event;
if (e.preventDefault)
e.preventDefault();
- e.returnValue = false;
+ e.returnValue = false;
},
preventDefaultForScrollKeys: function(e) {
if (hooch.scroll_keys[e.keyCode]) {
hooch.preventDefault(e);
return false;
@@ -1358,15 +1358,25 @@
}
this._super();
}
});
hooch.SelectActionChanger = hooch.FakeSelect.extend({
+ init: function($fake_select){
+ this.auto_submit = $fake_select.data('auto-submit');
+ this._super($fake_select);
+ },
select: function(fake_option){
var form = this.select_display.parents('form:first');
form.attr('action', fake_option.select_value);
this.select_display.html(fake_option.select_name);
this.select_display.trigger('click');
+ if (this.auto_submit){
+ this.submitForm();
+ }
+ },
+ submitForm: function(form){
+ form.submit();
}
});
hooch.FormFieldRevealer = hooch.Revealer.extend({
init: function($revealer){
this.children_id = $revealer.data('revealer-children-id');
@@ -1476,10 +1486,10 @@
$.fn.findExclude = function( selector, mask, result )
{
result = typeof result !== 'undefined' ? result : new jQuery();
this.children().each( function(){
thisObject = jQuery( this );
- if( thisObject.is( selector ) )
+ if( thisObject.is( selector ) )
result.push( this );
if( !thisObject.is( mask ) )
thisObject.findExclude( selector, mask, result );
});
return result;