提交 458973cd 编写于 作者: T Tyler Lindberg

Moved platform check out of input handler

上级 8466a3e9
......@@ -163,6 +163,10 @@
window.URL = window.URL || window.webkitURL;
window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;
// Use Command instead of Ctrl on Mac
var modifierKey = navigator.platform.toUpperCase().indexOf( 'MAC' ) >= 0 ?
"metaKey" : "ctrlKey";
Number.prototype.format = function (){
return this.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
};
......@@ -311,14 +315,11 @@
case 90: // Register Ctrl-Z for Undo, Ctrl-Shift-Z for Redo
var isMac = navigator.platform.toUpperCase().indexOf( 'MAC' ) >= 0;
var modifierKey = isMac ? event.metaKey : event.ctrlKey;
if ( modifierKey && event.shiftKey ) {
if ( event[modifierKey] && event.shiftKey ) {
editor.redo();
} else if ( modifierKey ) {
} else if ( event[modifierKey] ) {
editor.undo();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册