mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Merge pull request #4476 from jdfreder/rm_js_blankspace_onload
Fix: Remove space added by display(JavaScript) on page reload
This commit is contained in:
commit
97ea238485
@ -290,7 +290,6 @@ var IPython = (function (IPython) {
|
||||
OutputArea.prototype.append_output = function (json, dynamic) {
|
||||
// If dynamic is true, javascript output will be eval'd.
|
||||
this.expand();
|
||||
|
||||
// Clear the output if clear is queued.
|
||||
var needs_height_reset = false;
|
||||
if (this.clear_queued) {
|
||||
@ -425,11 +424,12 @@ var IPython = (function (IPython) {
|
||||
|
||||
OutputArea.prototype.append_display_data = function (json, dynamic) {
|
||||
var toinsert = this.create_output_area();
|
||||
this.append_mime_type(json, toinsert, dynamic);
|
||||
this._safe_append(toinsert);
|
||||
// If we just output latex, typeset it.
|
||||
if ( (json.latex !== undefined) || (json.html !== undefined) ) {
|
||||
this.typeset();
|
||||
if (this.append_mime_type(json, toinsert, dynamic)) {
|
||||
this._safe_append(toinsert);
|
||||
// If we just output latex, typeset it.
|
||||
if ( (json.latex !== undefined) || (json.html !== undefined) ) {
|
||||
this.typeset();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -446,13 +446,16 @@ var IPython = (function (IPython) {
|
||||
if(type == 'javascript'){
|
||||
if (dynamic) {
|
||||
this.append_javascript(json.javascript, md, element, dynamic);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
this['append_'+type](json[type], md, element);
|
||||
return true;
|
||||
}
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user