Fix for issue 1157 - Collapsible block prevents page scrolling on iPhone 4

- When we switched to virtual mouse events, I just did a straight translation of the code that existed which basically did the collapse/expand on mouseup. In order to factor in scrolling, I needed to move that code into a vclick handler and stopPropagation() and preventDefault() to make sure the button doesn't activate.
This commit is contained in:
Kin Blas 2011-04-19 16:57:13 -07:00
parent dbd68472b4
commit 7d9af0b2a8

View file

@ -121,6 +121,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
.not( "> .ui-collapsible-contain .ui-collapsible-contain" )
.trigger( "collapse" );
});
var set = collapsibleParent.find( ":jqmData(role=collapsible)" )
set.first()
@ -133,16 +134,15 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
}
collapsibleHeading
.bind("vmouseup", function(e){
.bind("vclick", function(e){
if( collapsibleHeading.is('.ui-collapsible-heading-collapsed') ){
collapsibleContain.trigger('expand');
}
else {
collapsibleContain.trigger('collapse');
}
e.preventDefault();
})
.bind("vclick",false );
return false;
});
}
});
})( jQuery );