src/aria/tools/contextual/ContextualMenu.js
function (value) {
                var document = Aria.$window.document;
                if (value) {
                    // add event listeners if AriaSkin is available
                    // (required as it uses widgets)
                    // TODO: investigate to plug with event delegation
                    // when ready
                    if (aria.widgets && aria.widgets.AriaSkin) {
                        this._enabled = true;
                        eventUtils.addListener(document, "contextmenu", {
                            fn : this._onContextMenu,
                            scope : this
                        });
                        if (ariaCoreBrowser.isSafari) {
                            // PTR 04547842: Safari does not support the
                            // ctrlKey property on contextmenu event
                            // register the mouseup event to get this
                            // information
                            eventUtils.addListener(document, "mouseup", {
                                fn : this._onSafariMouseUp,
                                scope : this
                            });
                        }
                    }
                } else {
                    this._enabled = false;
                    // remove event listeners
                    eventUtils.removeListener(document, "contextmenu", {
                        fn : this._onContextMenu
                    });
                    if (ariaCoreBrowser.isSafari) {
                        eventUtils.removeListener(document, "mouseup", {
                            fn : this._onSafariMouseUp
                        });
                    }
                }
            }
function (value) {
                var document = Aria.$window.document;
                if (value) {
                    // add event listeners if AriaSkin is available
                    // (required as it uses widgets)
                    // TODO: investigate to plug with event delegation
                    // when ready
                    if (aria.widgets && aria.widgets.AriaSkin) {
                        this._enabled = true;
                        eventUtils.addListener(document, "contextmenu", {
                            fn : this._onContextMenu,
                            scope : this
                        });
                        if (ariaCoreBrowser.isSafari) {
                            // PTR 04547842: Safari does not support the
                            // ctrlKey property on contextmenu event
                            // register the mouseup event to get this
                            // information
                            eventUtils.addListener(document, "mouseup", {
                                fn : this._onSafariMouseUp,
                                scope : this
                            });
                        }
                    }
                } else {
                    this._enabled = false;
                    // remove event listeners
                    eventUtils.removeListener(document, "contextmenu", {
                        fn : this._onContextMenu
                    });
                    if (ariaCoreBrowser.isSafari) {
                        eventUtils.removeListener(document, "mouseup", {
                            fn : this._onSafariMouseUp
                        });
                    }
                }
            }
function ( value ) { var document = Aria . $window . document ; if ( value ) { // add event listeners if AriaSkin is available // (required as it uses widgets) // TODO: investigate to plug with event delegation // when ready if ( aria . widgets && aria . widgets . AriaSkin ) { this . _enabled = true ; eventUtils . addListener ( document , "contextmenu" , { fn : this . _onContextMenu , scope : this } ) ; if ( ariaCoreBrowser . isSafari ) { // PTR 04547842: Safari does not support the // ctrlKey property on contextmenu event // register the mouseup event to get this // information eventUtils . addListener ( document , "mouseup" , { fn : this . _onSafariMouseUp , scope : this } ) ; } } } else { this . _enabled = false ; // remove event listeners eventUtils . removeListener ( document , "contextmenu" , { fn : this . _onContextMenu } ) ; if ( ariaCoreBrowser . isSafari ) { eventUtils . removeListener ( document , "mouseup" , { fn : this . _onSafariMouseUp } ) ; } } }
Enables or disables the contextual menu. Shoule not be called directly. Instead, the value should be set
in the app environment.
@param {Boolean} value if true, it enables the contextual menu, if false, it disables it
@protected
Enables or disables the contextual menu . Shoule not be called directly . Instead the value should be set in the app environment .