use non-mimetype-keyed metadata in the outputarea

This commit is contained in:
Paul Ivanov 2013-11-25 17:43:25 -08:00
parent 2e72ab3cd6
commit 459b5ea7ad

View File

@ -498,9 +498,19 @@ var IPython = (function (IPython) {
var type = OutputArea.display_order[type_i];
if(json[type] != undefined ){
var md = {};
if (json.metadata && json.metadata[type]) {
md = json.metadata[type];
};
if (json.metadata) {
md = json.metadata;
if (json.metadata[type]) {
// XXX: need some sort of dict.update, style here if
// we want to support the merging of the overall
// metadata with the mimetype specific metadata. For
// now, they are mutually exclusive - if the
// mimetype-keyed metadata exists, *it* is used,
// otherwise, only the message-wide metadata is
// available.
md = json.metadata[type];
}
}
if(type == 'javascript'){
if (dynamic) {
this.append_javascript(json.javascript, md, element, dynamic);