forked from SpinaCMS/Spina
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
9 changed files
with
632 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,8 @@ The Tailwind purger was created by [@dhh](https://twitter.com/dhh) for [tailwind | |
|
||
Icons were designed by [@steveschoger](https://twitter.com/steveschoger) - [Heroicons](https://github.com/tailwindlabs/heroicons). | ||
|
||
HotKeys support via [Hotkeys.js](https://wangchujiang.com/hotkeys/) | ||
|
||
The font used in Spina's admin panel is called Metropolis and was created by Chris Simpson [Metropolis](https://github.com/chrismsimpson/Metropolis) | ||
|
||
Copyright (c) 2015, Chris Simpson <[email protected]>. | ||
|
21 changes: 21 additions & 0 deletions
21
app/assets/javascripts/spina/controllers/hotkeys_controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Controller } from "stimulus" | ||
import hotkeys from "hotkeys" | ||
|
||
export default class extends Controller { | ||
static get targets() { | ||
return [ "button" ] | ||
} | ||
|
||
connect() { | ||
hotkeys(this.element.dataset.hotkeys, this.handleHotkeys.bind(this)) | ||
hotkeys.filter = (event) => true | ||
} | ||
|
||
handleHotkeys(event, handler) { | ||
event.preventDefault() | ||
if (this.hasButtonTarget) { | ||
this.buttonTarget.click() | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
//= require ./[email protected] |
Oops, something went wrong.