Skip to content

Commit 8e47676

Browse files
committed
HotKey navigation help
1 parent a1ac9cf commit 8e47676

File tree

1 file changed

+46
-16
lines changed

1 file changed

+46
-16
lines changed

web/templates/footer.html

Lines changed: 46 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,47 @@
163163
}
164164
);
165165

166-
shortcut.add("a", function(){
167-
if($('.l-sort__create-btn')[0]){
168-
location.href=$('.l-sort__create-btn').attr('href');
169-
}
166+
shortcut.add("a", function(evt){
167+
if (!evt.ctrlKey && !evt.shiftKey) {
168+
if ($('.l-sort__create-btn')[0]) {
169+
location.href=$('.l-sort__create-btn').attr('href');
170+
}
171+
}
172+
}, {
173+
'type': 'keyup',
174+
'propagate': false,
175+
'disable_in_input': true,
176+
'target': document
177+
}
178+
);
179+
180+
shortcut.add("n", function(evt){
181+
if (!evt.ctrlKey && !evt.shiftKey) {
182+
if ($('.l-sort__create-btn')[0]) {
183+
location.href=$('.l-sort__create-btn').attr('href');
184+
}
185+
}
186+
}, {
187+
'type': 'keyup',
188+
'propagate': false,
189+
'disable_in_input': true,
190+
'target': document
191+
}
192+
);
193+
194+
195+
shortcut.add("Ctrl+m", function(evt){
196+
console.log('ctrl+m');
197+
}, {
198+
'type': 'keyup',
199+
'propagate': false,
200+
'disable_in_input': true,
201+
'target': document
202+
}
203+
);
204+
205+
shortcut.add("m", function(evt){
206+
console.log('m');
170207
}, {
171208
'type': 'keyup',
172209
'propagate': false,
@@ -417,37 +454,30 @@
417454
$('.shortcuts').hide();
418455
});
419456

420-
421-
422-
/*jQuery('.ch-toggle').bind('change', function(evt) {
423-
evt.stopImmediatePropagation();
424-
console.log(123);
425-
});*/
426-
427457
VE.core.register();
428458
if (location.href.search(/list/) != -1) {
429459
var shift_select_ref = $('body').finderSelect({children: '.l-unit',
430460
'onFinish': function(evt) {
431-
/*var ref = $(evt.target);
461+
var ref = $(evt.target);
432462
$('.l-content').find('.l-unit .ch-toggle').attr('checked', false);
433463
$('.l-content').find('.l-unit.selected .ch-toggle').attr('checked', true);
434464

435465

436466
if ($('.l-content').find('.l-unit.selected').length == $('.l-content').find('.l-unit').length) {
437467
$('.toggle-all').addClass('clicked-on');
438-
}*/
468+
}
439469

440470
},
441471
'toggleAllHook': function() {
442-
/*if ($('.l-unit').length == $('.ch-toggle:checked').length) {
472+
if ($('.l-unit').length == $('.ch-toggle:checked').length) {
443473
$('.l-unit.selected').removeClass('selected');
444474
$('.ch-toggle').attr('checked', false);
445475
$('#toggle-all').attr('checked', false);
446476
}
447477
else {
448478
$('.ch-toggle').attr('checked', true);
449479
$('#toggle-all').attr('checked', true);
450-
}*/
480+
}
451481
}
452482
});
453483
$('table').on('mousedown', 'td', function(e) {
@@ -469,7 +499,7 @@
469499
<div class="close"></div>
470500
</div>
471501
<ul>
472-
<li><span class="key">a</span>Go to add form</li>
502+
<li><span class="key">n</span>Add New object</li>
473503
<li><span class="key">&lt;Ctrl&gt; + Enter</span>Save Form</li>
474504
<li class="step-top"><span class="key">&lt;Ctrl&gt; + Backspace</span>Cancel saving form</li>
475505

0 commit comments

Comments
 (0)