stepanvr/js-shortcuts — pull request #6 by jbarata (2013-02-07 23:03:12+00:00)
Title: Added registered lists concept and reactivating previous list on list removal

Hi there,

This PR adds a registered lists array that serves as a stack for started lists and allows us to get back and reactivate the previous started list on removal of a list.

Also added a public method (removeList(list)) that removes a list from Shortcuts object and reactivates the list that was previously started (the last one in the registered array), instead of stopping the whole thing.

This is very useful for cases where, for example, we have a main shortcut list that has a shortcut for opening a dialog with its own list of shortcuts (which itself can open other stuff with its own shortcuts). In this scenario, we can press the shortcut to open the dialog, do some stuff in the dialog (using its own shortcuts), then, before closing the dialog we call Shortcuts.removelist('the_dialog_list') and it will reactivate the previous registered list (in this example the main list).