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

Code_prettify button registration broken #1519

Closed
achampion opened this issue Aug 12, 2020 · 3 comments
Closed

Code_prettify button registration broken #1519

achampion opened this issue Aug 12, 2020 · 3 comments

Comments

@achampion
Copy link

achampion commented Aug 12, 2020

Versions:

notebook                          6.1.1
jupyter-contrib-nbextensions      0.5.1
jupyter-client                    6.1.6

Looking at the console I see all of the code_prettify extensions fail to load with button registration issues:

[code_prettify] error loading: TypeError: Cannot read property 'help' of undefined
    at toolbar.js:98
    at Array.forEach (<anonymous>)
    at MainToolBar.ToolBar.add_buttons_group (toolbar.js:85)
    at KernelExecOnCells.add_toolbar_button (kernel_exec_on_cell.js?v=20200811234053:199)
    at KernelExecOnCells.setup_for_new_kernel (kernel_exec_on_cell.js?v=20200811234053:277)
    at on_success (kernel_exec_on_cell.js?v=20200811234053:337)

I changed the KernelExecOnCells.prototype.add_toolbar_button function to:

KernelExecOnCells.prototype.add_toolbar_button = function() {
    var button_group_id = this.mod_name + '_button';
    if ($('#' + button_group_id).length < 1) {
        $(Jupyter.toolbar.add_buttons_group([this.cfg.actions.process_selected.name])).find('.btn').attr('id', button_group_id);
    }
};

To get it working again and seems a simpler approach than the current implementation.

@rgbkrk
Copy link

rgbkrk commented Aug 12, 2020

This is an issue in the current jupyter notebook release affecting extensions that I've fixed here: jupyter/notebook#5676

@rgbkrk
Copy link

rgbkrk commented Aug 14, 2020

Please upgrade to notebook 6.1.4 and let me know if it fixes the issue.

@achampion
Copy link
Author

6.1.3 on Pypi fixed the issue, thanks.

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

No branches or pull requests

2 participants