Skip to content

Commit

Permalink
fix(ui-sref): Use either .on or .bind for click handlers
Browse files Browse the repository at this point in the history
Closes #3035
  • Loading branch information
christopherthielen committed Oct 2, 2016
1 parent a3136ae commit b00f044
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ng1/directives/stateDirectives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
};
Expand Down Expand Up @@ -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);
});
}
};
Expand Down

0 comments on commit b00f044

Please sign in to comment.