]> git.za3k.com Git - flowy.git/commitdiff
Fix multiple shortcut support
authorZachary Vance <vanceza@gmail.com>
Thu, 28 May 2015 01:07:55 +0000 (18:07 -0700)
committerZachary Vance <vanceza@gmail.com>
Thu, 28 May 2015 01:09:35 +0000 (18:09 -0700)
dist/flowy.js
dist/flowy.unwrapped.js
src/library/viewShortcuts.js
src/views/todo.js

index 395bb7a4279df4aed470871f06474b04fe9912bf..2590c9fa472f42986c8ff432cf09cb6350e56f32 100644 (file)
@@ -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',
index 6fee3ce091dadc8ea63b9ceb35404ad9b8019885..c964b08e2a93d48a801987315eee36530134f854 100644 (file)
@@ -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',
index 260d3504b2ea592b73dfbc08257feec2f813362b..1ac718044099a07d7df133efb879c1b4183dfb18 100644 (file)
@@ -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
         });
index 12b9c2baac7f0119b46a4f7dcac9f37160c63b16..ac22778e88228e61cb211657c263206296fa57d3 100644 (file)
@@ -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',