From: Zachary Vance Date: Thu, 28 May 2015 01:07:55 +0000 (-0700) Subject: Fix multiple shortcut support X-Git-Url: https://git.za3k.com/?a=commitdiff_plain;h=aea9757504669cd3937b002cbc4a48537f4d1723;p=flowy.git Fix multiple shortcut support --- diff --git a/dist/flowy.js b/dist/flowy.js index 395bb7a..2590c9f 100644 --- a/dist/flowy.js +++ b/dist/flowy.js @@ -339,11 +339,11 @@ var Shortcut = (function(document, _) { var undelegateEvents = View.undelegateEvents; var ShortcutRegex = /^Shortcut\("([^")]*)", ?"([^")]*)", ?"([^")]*)"\) (.*)$/; function delegate(id, description, defaultKeybinding, objectType, callback){ - if (typeof(defaultKeybinding) !== 'string' && defaultKeybinding.split) defaultKeybinding = defaultKeybinding.split(','); + if (typeof(defaultKeybinding) === 'string' && defaultKeybinding.split) defaultKeybinding = defaultKeybinding.split(','); var shortcut = Shortcut.registerShortcut({ id: id, description: description, - keybinding: defaultKeybinding, // TODO: Add support for rebinding + keybinding: defaultKeybinding, // TODO: Add support for rebinding (load from database) object: objectType, action: callback }); @@ -417,8 +417,7 @@ var TodoView = Backbone.View.extend({ 'Shortcut("zoomIn", "Not Done - Zoom in", "alt+right") > .text': 'zoomIn', 'Shortcut("zoomOut", "Not Done - Zoom out", "alt+left") > .text': 'zoomOut', 'Shortcut("expand", "Not Done - Expand / collapse", "ctrl+space") > .text': 'expand', - //'Shortcut("indent", "Not Done - Indent", "tab,alt+shift+right") > .text': 'indent', - 'Shortcut("indent", "Not Done - Indent", "tab") > .text': 'indent', + 'Shortcut("indent", "Not Done - Indent", "tab,alt+shift+right") > .text': 'indent', 'Shortcut("outdent", "Not Done - Outdent", "shift+tab,alt+shift+left") > .text': 'outdent', 'Shortcut("moveDown", "Not Done - Move", "alt+shift+down") > .text': 'moveDown', 'Shortcut("moveUp", "Not Done - Move", "alt+shift+up") > .text': 'moveUp', diff --git a/dist/flowy.unwrapped.js b/dist/flowy.unwrapped.js index 6fee3ce..c964b08 100644 --- a/dist/flowy.unwrapped.js +++ b/dist/flowy.unwrapped.js @@ -338,11 +338,11 @@ var Shortcut = (function(document, _) { var undelegateEvents = View.undelegateEvents; var ShortcutRegex = /^Shortcut\("([^")]*)", ?"([^")]*)", ?"([^")]*)"\) (.*)$/; function delegate(id, description, defaultKeybinding, objectType, callback){ - if (typeof(defaultKeybinding) !== 'string' && defaultKeybinding.split) defaultKeybinding = defaultKeybinding.split(','); + if (typeof(defaultKeybinding) === 'string' && defaultKeybinding.split) defaultKeybinding = defaultKeybinding.split(','); var shortcut = Shortcut.registerShortcut({ id: id, description: description, - keybinding: defaultKeybinding, // TODO: Add support for rebinding + keybinding: defaultKeybinding, // TODO: Add support for rebinding (load from database) object: objectType, action: callback }); @@ -416,8 +416,7 @@ var TodoView = Backbone.View.extend({ 'Shortcut("zoomIn", "Not Done - Zoom in", "alt+right") > .text': 'zoomIn', 'Shortcut("zoomOut", "Not Done - Zoom out", "alt+left") > .text': 'zoomOut', 'Shortcut("expand", "Not Done - Expand / collapse", "ctrl+space") > .text': 'expand', - //'Shortcut("indent", "Not Done - Indent", "tab,alt+shift+right") > .text': 'indent', - 'Shortcut("indent", "Not Done - Indent", "tab") > .text': 'indent', + 'Shortcut("indent", "Not Done - Indent", "tab,alt+shift+right") > .text': 'indent', 'Shortcut("outdent", "Not Done - Outdent", "shift+tab,alt+shift+left") > .text': 'outdent', 'Shortcut("moveDown", "Not Done - Move", "alt+shift+down") > .text': 'moveDown', 'Shortcut("moveUp", "Not Done - Move", "alt+shift+up") > .text': 'moveUp', diff --git a/src/library/viewShortcuts.js b/src/library/viewShortcuts.js index 260d350..1ac7180 100644 --- a/src/library/viewShortcuts.js +++ b/src/library/viewShortcuts.js @@ -9,11 +9,11 @@ var undelegateEvents = View.undelegateEvents; var ShortcutRegex = /^Shortcut\("([^")]*)", ?"([^")]*)", ?"([^")]*)"\) (.*)$/; function delegate(id, description, defaultKeybinding, objectType, callback){ - if (typeof(defaultKeybinding) !== 'string' && defaultKeybinding.split) defaultKeybinding = defaultKeybinding.split(','); + if (typeof(defaultKeybinding) === 'string' && defaultKeybinding.split) defaultKeybinding = defaultKeybinding.split(','); var shortcut = Shortcut.registerShortcut({ id: id, description: description, - keybinding: defaultKeybinding, // TODO: Add support for rebinding + keybinding: defaultKeybinding, // TODO: Add support for rebinding (load from database) object: objectType, action: callback }); diff --git a/src/views/todo.js b/src/views/todo.js index 12b9c2b..ac22778 100644 --- a/src/views/todo.js +++ b/src/views/todo.js @@ -20,8 +20,7 @@ var TodoView = Backbone.View.extend({ 'Shortcut("zoomIn", "Not Done - Zoom in", "alt+right") > .text': 'zoomIn', 'Shortcut("zoomOut", "Not Done - Zoom out", "alt+left") > .text': 'zoomOut', 'Shortcut("expand", "Not Done - Expand / collapse", "ctrl+space") > .text': 'expand', - //'Shortcut("indent", "Not Done - Indent", "tab,alt+shift+right") > .text': 'indent', - 'Shortcut("indent", "Not Done - Indent", "tab") > .text': 'indent', + 'Shortcut("indent", "Not Done - Indent", "tab,alt+shift+right") > .text': 'indent', 'Shortcut("outdent", "Not Done - Outdent", "shift+tab,alt+shift+left") > .text': 'outdent', 'Shortcut("moveDown", "Not Done - Move", "alt+shift+down") > .text': 'moveDown', 'Shortcut("moveUp", "Not Done - Move", "alt+shift+up") > .text': 'moveUp',