Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
refactor(dropdown): change bind/unbind to on/off
Browse files Browse the repository at this point in the history
Closes #4895
  • Loading branch information
Foxandxss authored and wesleycho committed Nov 13, 2015
1 parent 85fdfc2 commit 4de49f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/dropdown/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])

this.open = function(dropdownScope) {
if (!openScope) {
$document.bind('click', closeDropdown);
$document.bind('keydown', keybindFilter);
$document.on('click', closeDropdown);
$document.on('keydown', keybindFilter);
}

if (openScope && openScope !== dropdownScope) {
Expand All @@ -24,8 +24,8 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])
this.close = function(dropdownScope) {
if (openScope === dropdownScope) {
openScope = null;
$document.unbind('click', closeDropdown);
$document.unbind('keydown', keybindFilter);
$document.off('click', closeDropdown);
$document.off('keydown', keybindFilter);
}
};

Expand Down

0 comments on commit 4de49f4

Please sign in to comment.