Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[various] update add_buttons_group to use action instead of button #1103

Merged
merged 2 commits into from
Oct 13, 2017

Conversation

jcb91
Copy link
Member

@jcb91 jcb91 commented Sep 20, 2017

As discussed in #1102

@jcb91 jcb91 changed the title [freeze] update add_buttons_group to use action instead of button [various] update add_buttons_group to use action instead of button Sep 25, 2017
@jcb91
Copy link
Member Author

jcb91 commented Oct 4, 2017

This looks mainly ok, but a few changes are needed:

  1. rebase onto current master, as there are now some merge conflicts
  2. accessing Jupyter.actions raises warnings, so it seems better to do it through Jupyter.keyboard_manager.actions.
  3. whenever we call ActionHandler.register, we should provide both an action name and a prefix (the prefix should be the nbextension filename, similar to that used in logs for lots of examples)
  4. various buttons were being created with ids, which the new formulation seems to have used as action names. This is ok, but they (the actions) need to have an id key set as well

@Sukneet
Copy link
Contributor

Sukneet commented Oct 5, 2017

Are you sure actions have an id key? I can't see that documented anywhere.
https://github.com/jupyter/notebook/blob/master/notebook/static/notebook/js/actions.js

Although, it won't hurt to add I guess.

@jcb91
Copy link
Member Author

jcb91 commented Oct 5, 2017

Apologies, you're right, the action doesn't have an id, so instead we need to pass an object with keys id and action to the toolbar registration function 😲

@Sukneet
Copy link
Contributor

Sukneet commented Oct 13, 2017

Sorry for not getting to this! Been pretty busy. I was going to do it tomorrow, but looks like you already did it. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants