Browse Source

[notebook] Add a new snippet with cmd+N/ctrl+N

Enrico Berti 10 years ago
parent
commit
8e20c57b31

+ 6 - 0
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -1443,6 +1443,12 @@ from desktop.views import _ko
       return false;
     });
 
+    $(window).bind("keydown", "ctrl+n alt+n meta+n", function (e) {
+      e.preventDefault();
+      viewModel.selectedNotebook().newSnippet();
+      return false;
+    });
+
     var initialResizePosition = 100;
 
     function getDraggableOptions(minY) {