swisnl / jQuery-contextMenu

jQuery contextMenu plugin & polyfill
https://swisnl.github.io/jQuery-contextMenu/
MIT License
2.24k stars 744 forks source link

Uncaught SyntaxError: Invalid shorthand property initializer #645

Closed LDShadowLord closed 6 years ago

LDShadowLord commented 6 years ago

When attempting to use the "disabled" option I receive the error: Uncaught SyntaxError: Invalid shorthand property initializer

The offending item is this: "g_bookmark": { name: "Go to Bookmark", disabled = true //disabled = function (itemKey, opt) {return doesBookmarkExist(uniqueid);} }

disabled = true is causing the issue. Originally I was using the callback but thought I had a bug in the doesBookmarkExist function.

I'm running "Chrome 66.0.3359.181 x64" on Windows 10, and i'm using the most recent build of "jQuery contextMenu 2" alongside "jQuery 3.2.1"

Any help would be greatly appreciated, even if it is just pointing out i'm a moron and have missed something obvious.