Merge pull request #6127 from minrk/fix-edit-md

cell toolbar and modal dialog fixes
Matthias Bussonnier 12 years ago
commit e4e50628c0

@ -124,7 +124,7 @@ define([
autoIndent: true,
mode: 'application/json',
});
var modal = modal({
var modal_obj = modal({
title: "Edit " + options.name + " Metadata",
body: dialogform,
buttons: {
@ -148,7 +148,7 @@ define([
keyboard_manager: options.keyboard_manager,
});
modal.on('shown.bs.modal', function(){ editor.refresh(); });
modal_obj.on('shown.bs.modal', function(){ editor.refresh(); });
};
var dialog = {

@ -278,7 +278,7 @@ define([
}
// If there are no controls or the cell is a rendered TextCell hide the toolbar.
if (!this.ui_controls_list.length || (this.cell_type != 'code' && this.cell.rendered)) {
if (!this.ui_controls_list.length || (this.cell.cell_type != 'code' && this.cell.rendered)) {
this.hide();
} else {
this.show();

@ -10,9 +10,15 @@ define([
var CellToolbar = celltoolbar.CellToolbar;
var raw_edit = function(cell){
dialog.edit_metadata(cell.metadata, function (md) {
cell.metadata = md;
var raw_edit = function (cell) {
dialog.edit_metadata({
md: cell.metadata,
callback: function (md) {
cell.metadata = md;
},
name: 'Cell',
notebook: this.notebook,
keyboard_manager: this.keyboard_manager
});
};
@ -30,6 +36,11 @@ define([
var register = function (notebook, events) {
CellToolbar.register_callback('default.rawedit', add_raw_edit_button);
raw_edit = $.proxy(raw_edit, {
notebook: notebook,
keyboard_manager: notebook.keyboard_manager
});
var example_preset = [];
example_preset.push('default.rawedit');

Loading…
Cancel
Save