IPywidget optional hide close button - Suggestion

179 views
Skip to first unread message

oscar6echo

unread,
Sep 20, 2016, 6:24:16 PM9/20/16
to Project Jupyter
Hi,

I see ipywidgets as a means to turn a notebook (almost) into a webappfrom the user's perspective, when the code cells are hidden.
But then the remaining 'close button' enables the user to delete the interactive widget...
So I think it would be good to be able to optionally hide this button upon creation of an ipywidget.

It is easy enough to hide all such buttons in a notebook with something like (1)
So maybe that's enough ?
It is more convoluted to do it for a particular cell with (2)
Actually it works only from the console, after selecting the target cell.

What do you think ?
Please quickly discard if there are good reasons against.

Thx


(1)
%%javascript
$('.widget-area .prompt .close').hide()

(2)
%%javascript
var jupyter= require('base/js/namespace');
var sc = jupyter.notebook.get_selected_cell();
var db = sc.widgetarea.widget_area.children()[0];
var b = db.firstChild;
$(b).css('visibility', 'hidden');

(There is probably a more direct way)

MinRK

unread,
Sep 22, 2016, 8:35:24 AM9/22/16
to Project Jupyter
It probably makes sense to do something like this in the dashboards view. In the regular notebook view, I'm not sure we would want users to not have access to closing things, though.


--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/1cc18888-e6eb-4dc5-a0f9-165b2f155055%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

oscar6echo

unread,
Sep 22, 2016, 4:51:39 PM9/22/16
to Project Jupyter
Thx for the link !
I did not know that extension: I'll read carefully.


To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages