mirror of
https://github.com/jupyter/notebook.git
synced 2025-04-12 14:00:27 +08:00
Fix bug where cell toolbars are not redrawn,
when cell metadata is changed.
This commit is contained in:
parent
e6939f9aa5
commit
bfdf9596fd
@ -392,6 +392,16 @@ define([
|
||||
*/
|
||||
Cell.prototype.set_text = function (text) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the metadata of the cell and triggers the celltoolbars to update.
|
||||
* @method set_metadata
|
||||
* @param {dictionary} metadata
|
||||
*/
|
||||
Cell.prototype.set_metadata = function (metadata) {
|
||||
this.metadata = metadata;
|
||||
this.celltoolbar.rebuild();
|
||||
};
|
||||
|
||||
/**
|
||||
* should be overritten by subclass
|
||||
@ -406,14 +416,13 @@ define([
|
||||
return data;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* should be overritten by subclass
|
||||
* @method fromJSON
|
||||
**/
|
||||
Cell.prototype.fromJSON = function (data) {
|
||||
if (data.metadata !== undefined) {
|
||||
this.metadata = data.metadata;
|
||||
this.set_metadata(data.metadata);
|
||||
}
|
||||
this.celltoolbar.rebuild();
|
||||
};
|
||||
|
@ -995,7 +995,7 @@ define([
|
||||
text = '';
|
||||
}
|
||||
//metadata
|
||||
target_cell.metadata = source_cell.metadata;
|
||||
target_cell.set_metadata(source_cell.metadata);
|
||||
|
||||
target_cell.set_text(text);
|
||||
// make this value the starting point, so that we can only undo
|
||||
@ -1029,7 +1029,7 @@ define([
|
||||
text = '';
|
||||
}
|
||||
// metadata
|
||||
target_cell.metadata = source_cell.metadata
|
||||
target_cell.set_metadata(source_cell.metadata);
|
||||
// We must show the editor before setting its contents
|
||||
target_cell.unrender();
|
||||
target_cell.set_text(text);
|
||||
@ -1067,7 +1067,7 @@ define([
|
||||
text = '';
|
||||
}
|
||||
//metadata
|
||||
target_cell.metadata = source_cell.metadata;
|
||||
target_cell.set_metadata(source_cell.metadata);
|
||||
// We must show the editor before setting its contents
|
||||
target_cell.unrender();
|
||||
target_cell.set_text(text);
|
||||
|
Loading…
x
Reference in New Issue
Block a user