Added registered lists concept and reactivating previous list on list removal#6
Open
jbarata wants to merge 1 commit into
Open
Added registered lists concept and reactivating previous list on list removal#6jbarata wants to merge 1 commit into
jbarata wants to merge 1 commit into
Conversation
… removal
added 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).
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).