diff --git a/.travis.yml b/.travis.yml
index 7b965b8a..766041b8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,8 @@
-language: php
-
sudo: false
-dist: precise
+
+cache:
+ directories:
+ - node_modules
env:
global:
@@ -9,30 +10,35 @@ env:
- GIT_EMAIL: couscous@couscous.io
- GH_REF: github.com/swisnl/jQuery-contextMenu
- SAUCE_USERNAME: "bbrala-contextmenu"
- - secure: "rEkgz8GHGUs0WDeuo1VPcQMAiO26dBs3b4dT1j67XtJEIHojcLNjjx2z434E+KaweuO0peWWmKFkT6ObZxJTnLd6xxyJjwhXERVaLNtwwlIxt20SpWCKFm5hOGFOwiCRP9pXK2vxWxnHKFJtGyX+pwDGjy0VtMF3ME8/KaHwfvs="
+ # GH_TOKEN
+ - secure: gWIh9j5sUgVn9DmVDYnmS4OT2GhHmsndLTPKRLgAF8LM4sa65SkSCNB4Xu5drcb1a6e4egOe0bXNgXSl70ApBoQIxPvjvWxLBCjPQBPD6kJjo2ovOsfxLARMSGAqlGN7hiocLi+s8qa7RP3uuJ373z+Ge+bLIV6vFxEjK9U3Iz4=
+ # SAUCE_ACCESS_KEY
- secure: UOse3txRLxLQKsPVQf6OKZZP3c0nLaPJ+4G2vR/qJqBXCTTCQ84+9qx9ih/40FDFcjVXwabJsdn0EhkqDw4h50OGdc58V1UfSbk7g1RiuvvRakOPTK0J9h7bEkBPb7QQXCvAVfOZ81DN6l5lMjmH1tiC2T/h/MNOLHPXsbzXElg=
-cache:
- directories:
- - node_modules
- - documentation/vendor
-
matrix:
include:
- - env: JQUERY=1 php=5.5
- - env: JQUERY=2 php=5.5
- - env: JQUERY=3 php=5.5
- - env: DOCUMENTATION=1 php=5.5
+ - language: node_js
+ node_js: "10"
+ env: JQUERY=1
+ - language: node_js
+ node_js: "10"
+ env: JQUERY=2
+ - language: node_js
+ node_js: "10"
+ env: JQUERY=3
+ - language: php
+ php: 7.4
+ env: DOCUMENTATION=1
allow_failures:
- - env: DOCUMENTATION=1 php=5.5
+ - env: DOCUMENTATION=1
install:
-- if [ "$JQUERY" ] ; then nvm install 7 && npm install -g yarn && yarn && yarn add jquery@$JQUERY ; fi
+- if [ "$JQUERY" ] ; then yarn add jquery@$JQUERY ; fi
- if [ "$DOCUMENTATION" ] ; then cd documentation && composer global require couscous/couscous ; fi
script:
-- if [ "$JQUERY" ] ; then yarn run test ; else /home/travis/.composer/vendor/bin/couscous travis-auto-deploy --php-version=5.5 ; fi
+- if [ "$JQUERY" ] ; then yarn run test ; else /home/travis/.config/composer/vendor/bin/couscous travis-auto-deploy --php-version=7.4 ; fi
- if [ "$JQUERY" ] && [ "$SAUCE_USERNAME" ] ; then yarn run test-sauce ; fi
deploy:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e9055e70..ec63c70c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,76 @@
## Changelog ##
+### Unreleased
+
+* Context menu no longer jumps to the top of the screen #749
+
+### 2.9.2
+
+* Fix reflow when adding click layer to page (fixed #721, thanks @Rhain)
+
+### 2.9.1
+
+* Fix error when closing the menu by clicking on the page without any element under that click point. (fixes #717)
+* Upgrades dependencies
+
+### 2.9.0
+
+#### Added
+
+* Added `dataAttr` option to add arbitrary data attributes to menu items.
+
+#### Changed
+
+* Updated dev dependencies.
+
+### 2.8.1
+
+#### Fixed
+
+* Added FontAwesome `fab` class to known classes.
+
+#### Documentation
+
+* Updated documentation for `callback` (thanks @arashdalir)
+
+
+### 2.8.0
+
+#### Added
+
+* Added support for `events.preShow` so you can enable default browser menu if needed (thanks @terwarf)
+
+### 2.7.1
+
+#### Fixed
+
+* A context menu appears outside the screen Under certain conditions (thanks @so-susa)
+* No font-awesome icons visible in submenu ([Issue #659](https://github.com/swisnl/jQuery-contextMenu/issues/659)) thanks @betafritz and @klues
+
+### 2.7.0
+
+#### Documentation
+
+* Add `getting started` to the documentation.
+* Fixed typo in documentation which breaks the `callback` demo.
+* Fixed typo `promis` => `promise` ([Issue #633](https://github.com/swisnl/jQuery-contextMenu/issues/633)).
+* Fixed arguments for callback option in documentation ([Issue #571](https://github.com/swisnl/jQuery-contextMenu/issues/571)).
+
+
+#### Added
+
+* Added support for Font Awesome 5 ([Issue #593](https://github.com/swisnl/jQuery-contextMenu/issues/593)), ([Issue #593](https://github.com/swisnl/jQuery-contextMenu/issues/593))
+
+### 2.6.4
+
+#### Fixed
+
+* `events.activated` is called without `options`as argument ([Issue #580](https://github.com/swisnl/jQuery-contextMenu/issues/580)).
+* LayerClick sometimes breaks when the source is not a mouseevent ([Issue #132](https://github.com/swisnl/jQuery-contextMenu/issues/132)).
+* The contextmenu now checks `visible` on items once instead of twice. Fixes [issue 612](https://github.com/swisnl/jQuery-contextMenu/issues/612).
+* Font awesome li height is now consistent again ([Issue #610](https://github.com/swisnl/jQuery-contextMenu/issues/610)).
+
+
### 2.6.3
#### Fixed
@@ -41,7 +112,7 @@
#### Fixed
* ContextMenu appears with wrong position ([Issue #502](https://github.com/swisnl/jQuery-contextMenu/issues/502) thanks @apptaro
-* Check if given selected value is a 0, if it is a zero so return it as is. Thanks @Falseee
+* Check if given selected value is a 0, if it is a zero so return it as is. Thanks @Falseee
* Events are never trigger when opening a contextMenu right after the other ([Issue #454](https://github.com/swisnl/jQuery-contextMenu/issues/454) thanks @kagant15
* Accesskey jQuery Modal Dialog not working ([Issue #506](https://github.com/swisnl/jQuery-contextMenu/issues/506) thanks @CiTRO33
* Fix submenu hover not always staying active if hovering over a submenu item. ([Issue #523](https://github.com/swisnl/jQuery-contextMenu/issues/523) thanks @tim-nz
@@ -55,7 +126,7 @@
### 2.4.3
-#### Changed
+#### Changed
* The inline style causes a Content Security Policy violation if style-src 'unsafe-inline' is not defined in the policy. [PR 498](https://github.com/swisnl/jQuery-contextMenu/pull/498) thanks @StealthDuck
@@ -66,10 +137,10 @@
* Added SauceLabs tests for common browsers.
### 2.4.2 ###
-
+
### Fixed
-* Focus not set on content editable element when right clicking the second time ([Issue #482](https://github.com/swisnl/jQuery-contextMenu/issues/482))
+* Focus not set on content editable element when right clicking the second time ([Issue #482](https://github.com/swisnl/jQuery-contextMenu/issues/482))
* `selectableSubMenu` broke disabling click menu (fixes ([Issue #493](https://github.com/swisnl/jQuery-contextMenu/issues/493))
@@ -91,7 +162,7 @@
#### Fixed
-* The contextmenu shows even if all items are set to visible:false ([Issue #473](https://github.com/swisnlhttps://github.com/swisnl/jQuery-contextMenu/issues/482/jQuery-contextMenu/issues/473))
+* The contextmenu shows even if all items are set to visible:false ([Issue #473](https://github.com/swisnlhttps://github.com/swisnl/jQuery-contextMenu/issues/482/jQuery-contextMenu/issues/473))
#### Documentation
@@ -162,14 +233,14 @@
#### Added
* Add option to show item title as HTML (thanks @brassard)
-* Full Font Awesome support
+* Full Font Awesome support
-#### Changed
+#### Changed
* Use relative units for css fixes ([Issue #386](https://github.com/swisnl/jQuery-contextMenu/issues/386)) (thanks @RoachMech)
* Change unicode characters in CSS to readable strings.
* Improved item styles (thanks @anseki)
-#### Fixed
+#### Fixed
* Force woff2 font creation for Windows some machines.
* Fix so that disabled items can't get focus anymore (thanks @anseki)
* Fix so menu size is calculated better no items will take up 2 lines again (thanks @anseki)
@@ -246,10 +317,10 @@
### 1.7.0 (August 29th 2015) ###
-* Touch support optimisations (by kccarter76)
+* Touch support optimisations (by kccarter76)
* changed .text to .html so there are no extra span's fixed - ([Issue #252](https://github.com/swisnl/jQuery-contextMenu/issues/252))
* added visibility callback to item definition
-* copy the HTML5 icon attribute when creating from HTML5 elements
+* copy the HTML5 icon attribute when creating from HTML5 elements
* growing menu when opening multiple times fixed - ([Issue #197](https://github.com/swisnl/jQuery-contextMenu/issues/197))
* fixed failure to run tests
diff --git a/README.md b/README.md
index adfd2422..d8601e40 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,13 @@
# jQuery contextMenu plugin & polyfill #
-[](https://travis-ci.org/swisnl/jQuery-contextMenu) [](https://www.npmjs.com/package/jquery-contextmenu) [](https://www.npmjs.com/package/jquery-contextmenu) [](https://github.com/swisnl/jQuery-contextMenu) [](https://cdnjs.com/libraries/jquery-contextmenu) []()
+[](https://greenkeeper.io/)
-$.contextMenu is a management facility for - you guessed it - context menus. It was designed for an application where there are hundreds of elements that may show a context menu - so intialization speed and memory usage are kept fairly small. It also allows to register context menus without providing actual markup, as $.contextMenu generates DOMElements as needed.
+[](https://app.travis-ci.com/github/swisnl/jQuery-contextMenu) [](https://www.npmjs.com/package/jquery-contextmenu) [](https://www.npmjs.com/package/jquery-contextmenu) [](https://cdnjs.com/libraries/jquery-contextmenu) []() [](https://plant.treeware.earth/swisnl/jQuery-contextMenu)
-[features](http://swisnl.github.io/jQuery-contextMenu/index.html) -
-[demo](http://swisnl.github.io/jQuery-contextMenu/demo.html) -
+`$.contextMenu` is a management facility for - you guessed it - context menus. It was designed for an application where there are hundreds of elements that may show a context menu - so intialization speed and memory usage are kept fairly small. It also allows to register context menus without providing actual markup, as `$.contextMenu` generates DOMElements as needed.
+
+[features](http://swisnl.github.io/jQuery-contextMenu/index.html) -
+[demo](http://swisnl.github.io/jQuery-contextMenu/demo.html) -
[documentation](http://swisnl.github.io/jQuery-contextMenu/docs.html)
@@ -36,6 +38,13 @@ $.contextMenu({
have a look at the [demos](http://swisnl.github.io/jQuery-contextMenu/demo.html).
+## Version 3.0 beta
+
+Version 3.0 is a restructure of the javascript into something more sane written in ES6. It consolidates all API's so callbacks are better documented and more concise. The basics are still the same, but all callbacks are structured differently.
+
+The goal of this refactor was mostly to make the ContextMenu easier to maintain, and make the API's more consise. It also adds JSdoc comments so the API documentation is generated from the code and it enables code completion.
+
+Check out the [3.x branch](https://github.com/swisnl/jQuery-contextMenu/tree/3.x), or install with `npm install jquery-contextmenu@next`.
## HTML5 Compatibility ##
@@ -45,7 +54,7 @@ Firefox 8 does not yet fully implement the contextmenu specification ([Ticket #6
[a](http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-a-element-to-define-a-command),
[button](http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-button-element-to-define-a-command),
[input](http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-input-element-to-define-a-command) and
-[option](http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-option-element-to-define-a-command)
+[option](http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-option-element-to-define-a-command)
usable as commands are being ignored altogether. It also doesn't (optically) distinguish between checkbox/radio and regular commands ([Bug #705292](https://bugzilla.mozilla.org/show_bug.cgi?id=705292)).
* [contextmenu specs](http://www.w3.org/TR/html5/interactive-elements.html#context-menus)
@@ -58,7 +67,7 @@ Note: While the specs note <option>s to be renderd as regular commands, $.
$.contextMenu("html5");
```
-## Interaction Principles
+## Interaction Principles
You're (obviously) able to use the context menu with your mouse. Once it is opened, you can also use the keyboard to (fully) navigate it.
@@ -87,11 +96,19 @@ Besides the obvious, browser also react to alphanumeric key strokes. Hitting