shortcuts (Namespace)
Description
Shortcuts
Methods
-
shortcut
- ch.onkeybackspace | ch.onkeytab | ch.onkeyenter | ch.onkeyesc | ch.onkeyleftarrow | ch.onkeyuparrow | ch.onkeyrightarrow | ch.onkeydownarrow : Shortcut to subscribe. -
name
- String : A name to add in the collection. -
callback
- function : A given function. -
name
- String : A given name from the collection. -
name
- String : A given name from the collection. -
name
- String : A name to remove from the collection. -
shortcut
- ch.onkeybackspace | ch.onkeytab | ch.onkeyenter | ch.onkeyesc | ch.onkeyleftarrow | ch.onkeyuparrow | ch.onkeyrightarrow | ch.onkeydownarrow : Shortcut to unsubscribe. -
callback
- function : A given function.
.add(shortcut, name, callback) → {Object}
Add a callback to a shortcut with given name.
// Add a callback to ESC key with "component" name.
ch.shortcuts.add(ch.onkeyesc, 'component', component.hide);
.off(name) → {Object}
Turn off shortcuts associated to a given name.
// Turn off shortcuts associated to "component" name.
ch.shortcuts.off('component');
.on(name) → {Object}
Turn on shortcuts associated to a given name.
// Turn on shortcuts associated to "component" name.
ch.shortcuts.on('component');
.remove(name, shortcut, callback) → {Object}
Removes a callback from a shortcut with given name.
// Remove a callback from ESC key with "component" name.
ch.shortcuts.remove(ch.onkeyesc, 'component', component.hide);