diff --git a/resources/views/header.blade.php b/resources/views/header.blade.php index 82b0afc57274..528ba9f7982b 100644 --- a/resources/views/header.blade.php +++ b/resources/views/header.blade.php @@ -287,50 +287,6 @@ $('#search').focusin(onSearchFocus); $('#search').blur(onSearchBlur); - Mousetrap.bind('?', function(e) { - console.log('heree'); - $('#helpModal').modal('show'); - }); - - Mousetrap.bind('/', function(e) { - event.preventDefault(); - $('#search').focus(); - }); - - Mousetrap.bind('d', function(e) { - location.href = "{{ url('/dashboard') }}"; - }); - - Mousetrap.bind('s', function(e) { - location.href = "{{ url('/settings/company_details') }}"; - }); - - Mousetrap.bind('h', function(e) { - $('#right-menu-toggle').trigger('click'); - }); - - Mousetrap.bind('m', function(e) { - $('#left-menu-toggle').trigger('click'); - }); - - @foreach([ - 'i' => ENTITY_INVOICE, - 'p' => ENTITY_PAYMENT, - 'e' => ENTITY_EXPENSE, - 't' => ENTITY_TASK, - 'c' => ENTITY_CLIENT, - 'q' => ENTITY_QUOTE, - 'v' => ENTITY_VENDOR, - 'r' => ENTITY_RECURRING_INVOICE, - ] as $key => $value) - Mousetrap.bind('n {{ $key }}', function(e) { - location.href = "{{ url($value . 's/create') }}"; - }); - Mousetrap.bind('l {{ $key }}', function(e) { - location.href = "{{ url($value . 's') }}"; - }); - @endforeach - // manage sidebar state function setupSidebar(side) { $("#" + side + "-menu-toggle").click(function(e) { @@ -771,89 +727,7 @@ @endif - +@include('partials.keyboard_shortcuts') diff --git a/resources/views/partials/keyboard_shortcuts.blade.php b/resources/views/partials/keyboard_shortcuts.blade.php new file mode 100644 index 000000000000..34de093da68b --- /dev/null +++ b/resources/views/partials/keyboard_shortcuts.blade.php @@ -0,0 +1,131 @@ + + + + +