Skip to content

Commit

Permalink
Merge pull request #6 from talis/fix-click-away-to-close
Browse files Browse the repository at this point in the history
Allow closing of context menu even when disabled
  • Loading branch information
pads authored Sep 8, 2020
2 parents f048d26 + 37488aa commit 774fa9c
Show file tree
Hide file tree
Showing 12 changed files with 5,898 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2
10.22.0
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
dist: xenial
addons:
chrome: stable
services:
- xvfb
language: node_js
node_js:
- stable
- 10
before_script:
- npm install -g gulp
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changes to ng-context-menu

## 1.1.0
1. Added #6: Allow closing of context menu even when disabled. @pads

## v1.0.3
1. Added #1: Move to Travis CI for building. @pads
2. Added #4: Fix positioning issue in IE. Thanks @ajwild!

## v1.0.1
1. Added #30: Add callback for when the context menu is closed. Thanks @andrewburgess!
2. Added #31: Use flat-github-ribbon.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
files and running a development server. You'll need to run ```npm install``` in order to install the development
dependencies and ```npm install -g gulp``` in order to install [gulp](http://gulpjs.com). The development server should
be available at [http://localhost:8080/](http://localhost:8080/).
4. Run ```gulp test``` to execute browser tests, this requires Firefox is installed and available in your PATH.
4. Run ```gulp test``` to execute browser tests, this requires Chrome is installed and available in your PATH.
5. Increment the version number in package.json, bower.json, and src/ng-context-menu.js
6. Create pull requests on the **development** branch not master!

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng-context-menu",
"version": "1.0.3",
"version": "1.1.0",
"description": "An AngularJS directive to display a context menu when a right-click event is triggered",
"keywords": [
"ng-context-menu",
Expand Down
9 changes: 4 additions & 5 deletions dist/ng-context-menu.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* ng-context-menu - v1.0.3 - An AngularJS directive to display a context menu
* ng-context-menu - v1.1.0 - An AngularJS directive to display a context menu
* when a right-click event is triggered
*
* @author Ian Kennington Walter (http://ianvonwalter.com)
Expand Down Expand Up @@ -107,16 +107,15 @@
});

function handleKeyUpEvent(event) {
if (!$scope.disabled() && opened && event.keyCode === 27) {
if (opened && event.keyCode === 27) {
$scope.$apply(function() {
close(ContextMenuService.menuElement);
});
}
}

function handleClickEvent(event) {
if (!$scope.disabled() &&
opened &&
if (opened &&
(event.button !== 2 ||
event.target !== ContextMenuService.element)) {
$scope.$apply(function() {
Expand All @@ -140,4 +139,4 @@
};
}
]);
})(angular);
})(angular);
2 changes: 1 addition & 1 deletion dist/ng-context-menu.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ gulp.task('protractor', function(done) {
configFile: 'protractor.conf.js',
args: [
'--baseUrl', 'http://127.0.0.1:' + program.port,
'--browser', program.browsers ? program.browsers[0] : 'firefox'
'--browser', program.browsers ? program.browsers[0] : 'chrome'
]
}))
.on('end', function() {
Expand Down
Loading

0 comments on commit 774fa9c

Please sign in to comment.