Skip to content

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

Merged
jcb91 merged 2 commits intoipython-contrib:masterfrom
Sukneet:master
Oct 13, 2017
Merged

[various] update add_buttons_group to use action instead of button#1103
jcb91 merged 2 commits intoipython-contrib:masterfrom
Sukneet:master

Conversation

@jcb91
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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