##// END OF EJS Templates
document initially hidden javascript container
MinRK -
Show More
@@ -368,6 +368,11 b' class Javascript(DisplayObject):'
368 368 in the frontend. If the data is a URL, the data will first be
369 369 downloaded and then displayed.
370 370
371 In the Notebook, the containing element will be available as `element`,
372 and jQuery will be available. The output area starts hidden, so if
373 the js appends content to `element` that should be visible, then
374 it must call `container.show()` to unhide the area.
375
371 376 Parameters
372 377 ----------
373 378 data : unicode, str or bytes
@@ -686,13 +686,14 b' var IPython = (function (IPython) {'
686 686 };
687 687
688 688
689 CodeCell.prototype.append_javascript = function (js, e) {
689 CodeCell.prototype.append_javascript = function (js, container) {
690 690 // We just eval the JS code, element appears in the local scope.
691 691 var element = $("<div/>").addClass("box_flex1 output_subarea");
692 e.append(element);
692 container.append(element);
693 693 // Div for js shouldn't be drawn, as it will add empty height to the area.
694 e.hide();
695
694 container.hide();
695 // If the Javascript appends content to `element` that should be drawn, then
696 // it must also call `container.show()`.
696 697 eval(js);
697 698 }
698 699
General Comments 0
You need to be logged in to leave comments. Login now