mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-20 17:43:24 +00:00
Add keyboard shortcut 's' to toggle sidebar
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
define([
|
||||
"jQuery",
|
||||
"Mousetrap",
|
||||
"core/navigation"
|
||||
], function($, Mousetrap, navigation){
|
||||
"core/navigation",
|
||||
"core/sidebar"
|
||||
], function($, Mousetrap, navigation, sidebar){
|
||||
// Bind keyboard shortcuts
|
||||
var init = function() {
|
||||
// Next
|
||||
@@ -16,6 +17,12 @@ define([
|
||||
navigation.goPrev();
|
||||
return false;
|
||||
});
|
||||
|
||||
// Toggle Summary
|
||||
Mousetrap.bind(['s'], function(e) {
|
||||
sidebar.toggle();
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user