Skip to content

Commit

Permalink
Merge pull request #142 from Ilya-Skiba/close_menu_event
Browse files Browse the repository at this point in the history
Adding possibility to specify custom close event
  • Loading branch information
josetaira authored Sep 18, 2018
2 parents 498115d + 24b3d27 commit fe3aaf3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Add a reference to `contextMenu.js`. In your app config add `ui.bootstrap.contex
- `context-menu-class` - A string literal containing a custom class to be added to the context menu (The <ul> elements)
- `allow-event-propagation` - (Default: false) A boolean determining whether to allow event propagation. Note that if you set this to true, and don’t catch it with something else the browser’s context menu will be shown on top of this library’s context menu.
- `model` - (See Model Attribute below)
- `close-menu-on` - (Default: '') A string literal containing event for triggering menu close action.

### View

Expand Down
6 changes: 6 additions & 0 deletions contextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,12 @@
});
});
});

if (attrs.closeMenuOn) {
$scope.$on(attrs.closeMenuOn, function () {
removeAllContextMenus();
});
}
};
}]);
// eslint-disable-next-line angular/window-service
Expand Down

0 comments on commit fe3aaf3

Please sign in to comment.