Browse Source

HotKey navigation help

Serghey Rodin 10 years ago
parent
commit
8e47676fda
1 changed files with 46 additions and 16 deletions
  1. 46 16
      web/templates/footer.html

+ 46 - 16
web/templates/footer.html

@@ -163,10 +163,47 @@
                   }
               );
 
-              shortcut.add("a", function(){
-                if($('.l-sort__create-btn')[0]){
-                  location.href=$('.l-sort__create-btn').attr('href');
-                }
+              shortcut.add("a", function(evt){
+                  if (!evt.ctrlKey && !evt.shiftKey) {
+                      if ($('.l-sort__create-btn')[0]) {
+                          location.href=$('.l-sort__create-btn').attr('href');
+                      }
+                  }
+              }, {
+                  'type':             'keyup',
+                  'propagate':        false,
+                  'disable_in_input': true,
+                  'target':           document
+                  }
+              );
+
+              shortcut.add("n", function(evt){
+                  if (!evt.ctrlKey && !evt.shiftKey) {
+                      if ($('.l-sort__create-btn')[0]) {
+                          location.href=$('.l-sort__create-btn').attr('href');
+                      }
+                  }
+              }, {
+                  'type':             'keyup',
+                  'propagate':        false,
+                  'disable_in_input': true,
+                  'target':           document
+                  }
+              );
+
+
+              shortcut.add("Ctrl+m", function(evt){
+                console.log('ctrl+m');
+              }, {
+                  'type':             'keyup',
+                  'propagate':        false,
+                  'disable_in_input': true,
+                  'target':           document
+                  }
+              );
+
+              shortcut.add("m", function(evt){
+                console.log('m');
               }, {
                   'type':             'keyup',
                   'propagate':        false,
@@ -417,29 +454,22 @@
                 $('.shortcuts').hide();
               });
 
-
-
-            /*jQuery('.ch-toggle').bind('change', function(evt) {
-                evt.stopImmediatePropagation();
-                console.log(123);
-            });*/
-
             VE.core.register();
             if (location.href.search(/list/) != -1) {
                 var shift_select_ref = $('body').finderSelect({children: '.l-unit', 
                     'onFinish': function(evt) {
-                        /*var ref = $(evt.target);
+                        var ref = $(evt.target);
                         $('.l-content').find('.l-unit .ch-toggle').attr('checked', false);
                         $('.l-content').find('.l-unit.selected .ch-toggle').attr('checked', true);
 
 
                         if ($('.l-content').find('.l-unit.selected').length == $('.l-content').find('.l-unit').length) {
                             $('.toggle-all').addClass('clicked-on');
-                        }*/
+                        }
 
                     },
                     'toggleAllHook': function() {
-                        /*if ($('.l-unit').length == $('.ch-toggle:checked').length) {
+                        if ($('.l-unit').length == $('.ch-toggle:checked').length) {
                             $('.l-unit.selected').removeClass('selected');
                             $('.ch-toggle').attr('checked', false);
                             $('#toggle-all').attr('checked', false);
@@ -447,7 +477,7 @@
                         else {
                             $('.ch-toggle').attr('checked', true);
                             $('#toggle-all').attr('checked', true);
-                        }*/
+                        }
                     }
                 });
                 $('table').on('mousedown', 'td', function(e) {
@@ -469,7 +499,7 @@
         <div class="close"></div>
       </div>
       <ul>
-        <li><span class="key">a</span>Go to add form</li>
+        <li><span class="key">n</span>Add New object</li>
         <li><span class="key">&lt;Ctrl&gt; + Enter</span>Save Form</li>
         <li class="step-top"><span class="key">&lt;Ctrl&gt; + Backspace</span>Cancel saving form</li>