Permalink
Browse files

[fix] jQueryExtends: opabind a bit more error prone

  • Loading branch information...
1 parent 45be11d commit c1246dd6cb17df273c456ff5a759476894a82b79 @Aqua-Ye Aqua-Ye committed Dec 8, 2011
Showing with 7 additions and 5 deletions.
  1. +1 −1 opabsl/jsbsl/bslDom.js
  2. +6 −4 opabsl/jsbsl/jQueryExtends.js
@@ -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
@@ -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))
}

0 comments on commit c1246dd

Please sign in to comment.