Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"event is not defined" when right click. #871

Closed
Likey opened this issue Apr 4, 2013 · 1 comment
Closed

"event is not defined" when right click. #871

Likey opened this issue Apr 4, 2013 · 1 comment

Comments

@Likey
Copy link

Likey commented Apr 4, 2013

I use v2.1.1

When I right click on <canvas> of game, I get a message from Firefox console:

ReferenceError: event is not defined

The line 253 ~ 263 of CCApplication.js is:

cc.setContextMenuEnable = function (enabled) {
    cc._isContextMenuEnable = enabled;
    if (!cc._isContextMenuEnable) {
        cc.canvas.oncontextmenu = function () {
            event.returnValue = false;
        };
    } else {
        cc.canvas.oncontextmenu = function () {
        };
    }
};

The problem is at line 257:

event.returnValue = false;

I think that the code is to prevent contextmenu on right click.
Is it better to replace line 257 with following:

return false;
@dingpinglv
Copy link
Contributor

Thank you, Chen.
I will fix this issue soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants