/*global self: false */

/**
 * Emits events for left and right clicks.
 */
(function (widget) {
    'use strict';

    widget.addEventListener('click', function (event) {
        if (event.button === 0 && event.shiftKey === false) {
            self.port.emit('left-click');
        }

        if (event.button === 2 || (event.button === 0 && event.shiftKey === true)) {
            self.port.emit('right-click');
        }
        event.preventDefault();
    }, false);

    // Prevent the addon bar context menu from showing on right click
    widget.addEventListener('contextmenu', function (event) {
        event.preventDefault();
    }, false);
}(this));

/*global self: false */

/**
 * Emits events for left and right clicks.
 */
(function (widget) {
    'use strict';

    widget.addEventListener('click', function (event) {
        if (event.button === 0 && event.shiftKey === false) {
            self.port.emit('left-click');
        }

        if (event.button === 2 || (event.button === 0 && event.shiftKey === true)) {
            self.port.emit('right-click');
        }
        event.preventDefault();
    }, false);
}(this));

Remove widget addon bar context menu workaround.
Remove widget addon bar context menu workaround.

Remove the widget 'Prevent the addon bar context menu from showing on right click' workaround. This bug was fixed in Addon SDK 1.6.
