Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/webix-hub/jet-hotkey
Hotkey handler for Webix Jet apps
https://github.com/webix-hub/jet-hotkey
Last synced: 12 days ago
JSON representation
Hotkey handler for Webix Jet apps
- Host: GitHub
- URL: https://github.com/webix-hub/jet-hotkey
- Owner: webix-hub
- Created: 2020-02-06T10:46:25.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-06T10:58:43.000Z (almost 5 years ago)
- Last Synced: 2024-11-16T01:51:31.538Z (about 1 month ago)
- Language: JavaScript
- Homepage: https://webix.com/webixjet/
- Size: 1000 Bytes
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Hotkey handler for Webix Jet apps
================## Why it is necessary
Helpers allow to define hotkeys which are activated only when
some view is rendered or only when some view has a focus.Hotkey handlers will be automatically detached on view destruction.
## How to use
```js
import hotkey from "jet-hotkey";export default class MyView extends JetView {
confit(){
return { view:"datatable" };
}
init() {
// will be active while this view is visible
this.on(hotkey(), "ESC", () => this.app.show("/top"));
// will be active when datatable has focus
this.on(hotkey(this.getRoot()), "DELETE", () =>
this.app.callEvent("app:action", ["delete"])
);
}
}
```