Skip to content

Commit

Permalink
[fix] jQueryExtends: opabind a bit more error prone
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Ye committed Dec 8, 2011
1 parent 45be11d commit c1246dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion opabsl/jsbsl/bslDom.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@
##register bind: Dom.private.element, string, (Dom.event -> void) -> Dom.event_handler
##args(dom, event, f)
{
return dom.opabind(event, f, function(e){return null}, false, false);
return dom.opabind(event, f, null, false, false);
}

##register bind_with_options: Dom.private.element, string, (Dom.event -> void), option(Dom.event -> Dom.event_propagation), bool, bool -> Dom.event_handler
Expand Down
10 changes: 6 additions & 4 deletions opabsl/jsbsl/jQueryExtends.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,12 @@ $.fn.extend({
var ns = name + "." + Math.random()
function f(e)
{
var prop = prop_fn(dom_event_to_opa_event(e))
if (prop != null) {
if (prop.stop_propagation) e.stopPropagation()
if (prop.prevent_default) e.preventDefault()
if (prop_fn != null) {
var prop = prop_fn(dom_event_to_opa_event(e))
if (prop != null) {
if (prop.stop_propagation) e.stopPropagation()
if (prop.prevent_default) e.preventDefault()
}
}
return fn(dom_event_to_opa_event(e))
}
Expand Down

0 comments on commit c1246dd

Please sign in to comment.