Permalink
Browse files

fix(ui-sref): Use either .on or .bind for click handlers

Closes #3035
  • Loading branch information...
1 parent a3136ae commit b00f04485c8bb6436e1811259e69e904e4dd084b @christopherthielen christopherthielen committed Sep 28, 2016
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/ng1/directives/stateDirectives.ts
@@ -181,9 +181,9 @@ function $StateRefDirective($state: StateService, $timeout: ITimeoutService) {
if (!type.clickable) return;
hookFn = clickHook(element, $state, $timeout, type, function() { return def; });
- element.on("click", hookFn);
+ element[element.on ? 'on' : 'bind']("click", hookFn);
scope.$on('$destroy', function() {
- element.off("click", hookFn);
+ element[element.off ? 'off' : 'unbind']("click", hookFn);
});
}
};
@@ -234,9 +234,9 @@ function $StateRefDynamicDirective($state: StateService, $timeout: ITimeoutServi
if (!type.clickable) return;
hookFn = clickHook(element, $state, $timeout, type, function() { return def; });
- element.on("click", hookFn);
+ element[element.on ? 'on' : 'bind']("click", hookFn);
scope.$on('$destroy', function() {
- element.off("click", hookFn);
+ element[element.off ? 'off' : 'unbind']("click", hookFn);
});
}
};

0 comments on commit b00f044

Please sign in to comment.