Merge pull request #1952 from gnestor/display_order-index

Set mimerender index in `OutputArea.display_order`
This commit is contained in:
Thomas Kluyver 2016-12-07 16:33:54 +01:00 committed by GitHub
commit f0050e9bf8

View File

@ -1072,11 +1072,15 @@ define([
[MIME_PDF] : append_pdf
};
OutputArea.prototype.register_mime_type = function (mimetype, append, safe) {
OutputArea.prototype.mime_types = function () {
return OutputArea.display_order;
};
OutputArea.prototype.register_mime_type = function (mimetype, append, options) {
if (mimetype && typeof(append) === 'function') {
OutputArea.output_types.push(mimetype);
if (safe) OutputArea.safe_outputs[mimetype] = true;
OutputArea.display_order.unshift(mimetype);
if (options.safe) OutputArea.safe_outputs[mimetype] = true;
OutputArea.display_order.splice(options.index || 0, 0, mimetype);
OutputArea.append_map[mimetype] = append;
}
};