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

Ctrl-z undo twice #60

Open
GoogleCodeExporter opened this issue Sep 1, 2015 · 0 comments
Open

Ctrl-z undo twice #60

GoogleCodeExporter opened this issue Sep 1, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

When I type ctrl-z, the undo action is performed twice. Not handling the "y" 
and "z" event in util.addEvent() in Markdown.Editor.js line 1255 corrects this 
problem.


    util.addEvent(inputBox, keyEvent, function (key) {

            // Check to see if we have a button key and, if so execute the callback.
            if ((key.ctrlKey || key.metaKey) && !key.altKey && !key.shiftKey) {

                var keyCode = key.charCode || key.keyCode;
                var keyCodeStr = String.fromCharCode(keyCode).toLowerCase();

                switch (keyCodeStr) {
                    ....
                    case "h":
                        doClick(buttons.heading);
                        break;
                    case "r":
                        doClick(buttons.hr);
                        break;
                    case "y":
                        //doClick(buttons.redo);
                        break;
                    case "z":
                        //if (key.shiftKey) {
                        //    doClick(buttons.redo);
                        //}
                        //else {
                        //    doClick(buttons.undo);
                        //}
                        break;
                    default:
                        return;
                }

Original issue reported on code.google.com by [email protected] on 1 Jun 2013 at 4:02

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

No branches or pull requests

1 participant