From 8e47676fda395e9a824f0eaf0546f59012b9822a Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Thu, 16 Jul 2015 02:24:42 +0300 Subject: [PATCH] HotKey navigation help --- web/templates/footer.html | 62 +++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 16 deletions(-) diff --git a/web/templates/footer.html b/web/templates/footer.html index 5f328188..59b99ec9 100644 --- a/web/templates/footer.html +++ b/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 @@