Chico UI - Doc

v1.0.0

Namespace shortcuts

Description

Shortcuts

Methods

.add(shortcut, name, callback) → {Object}



    

Add a callback to a shortcut with given name.

// Add a callback to ESC key with "widget" name.
ch.shortcuts.add(ch.onkeyesc, 'widget', widget.hide);

.off(name) → {Object}



    

Turn off shortcuts associated to a given name.

  • name - String : A given name from the collection.
// Turn off shortcuts associated to "widget" name.
ch.shortcuts.off('widget');

.on(name) → {Object}



    

Turn on shortcuts associated to a given name.

  • name - String : A given name from the collection.
// Turn on shortcuts associated to "widget" name.
ch.shortcuts.on('widget');

.remove(name, shortcut, callback) → {Object}



    

Removes a callback from a shortcut with given name.

// Remove a callback from ESC key with "widget" name.
ch.shortcuts.remove(ch.onkeyesc, 'widget', widget.hide);