mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-23 12:49:41 +08:00
Merge pull request #5928 from mishaschwartz/persist-cell-id
Ensure that cell ids persist after save
This commit is contained in:
commit
57db70979b
@ -490,6 +490,9 @@ define([
|
||||
var data = {};
|
||||
// deepcopy the metadata so copied cells don't share the same object
|
||||
data.metadata = JSON.parse(JSON.stringify(this.metadata));
|
||||
if (this.id !== undefined) {
|
||||
data.id = this.id;
|
||||
}
|
||||
if (data.metadata.deletable) {
|
||||
delete data.metadata.deletable;
|
||||
}
|
||||
@ -511,6 +514,9 @@ define([
|
||||
if (data.metadata !== undefined) {
|
||||
this.metadata = data.metadata;
|
||||
}
|
||||
if (data.id !== undefined) {
|
||||
this.id = data.id;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@ -1648,6 +1648,9 @@ define([
|
||||
if (cell_json.metadata.deletable !== undefined) {
|
||||
delete cell_json.metadata.deletable;
|
||||
}
|
||||
if (cell_json.id !== undefined) {
|
||||
delete cell_json.id;
|
||||
}
|
||||
this.clipboard.push(cell_json);
|
||||
}
|
||||
this.enable_paste();
|
||||
|
Loading…
Reference in New Issue
Block a user