diff --git a/notebook/static/notebook/js/celltoolbarpresets/rawcell.js b/notebook/static/notebook/js/celltoolbarpresets/rawcell.js
index 7cfc43b695..647f00856a 100644
--- a/notebook/static/notebook/js/celltoolbarpresets/rawcell.js
+++ b/notebook/static/notebook/js/celltoolbarpresets/rawcell.js
@@ -26,22 +26,35 @@ define([
function(cell, value) {
if (value === "-") {
delete cell.metadata.raw_mimetype;
- } else if (value === 'dialog'){
- var dialog = $('
').append(
- $("")
- .text(i18n.msg._("Set the MIME type of the raw cell:"))
- ).append(
- $("
")
- ).append(
- $('').attr('type','text').attr('size','25')
- .val(cell.metadata.raw_mimetype || "-")
- );
+ } else if (value === 'dialog') {
+ var message =
+ i18n.msg._("Set the MIME type of the raw cell:");
+
+ var mimeinput = $('')
+ .attr('type', 'text')
+ .attr('size', '25')
+ .attr('name', 'mimetype')
+ .val(cell.metadata.raw_mimetype || "-");
+
+ var dialogform = $('').attr('title', i18n.msg._("Edit MIME type"))
+ .append(
+ $('').append(
+ $('').append(
+ $('')
+ .attr('for', 'mimetype')
+ .text(message)
+ )
+ .append($('
'))
+ .append(mimeinput)
+ )
+ );
+
dialog.modal({
title: i18n.msg._("Raw Cell MIME Type"),
- body: dialog,
+ body: dialogform,
buttons : {
- "Cancel": {},
- "OK": {
+ Cancel: {},
+ OK: {
class: "btn-primary",
click: function () {
console.log(cell);
@@ -50,6 +63,8 @@ define([
}
}
},
+ notebook: cell.notebook,
+ keyboard_manager: cell.keyboard_manager,
open : function (event, ui) {
var that = $(this);
// Upon ENTER, click the OK button.