mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-30 12:11:32 +08:00
Merge pull request #6857 from jdfreder/celltoolbar_metadata_fix
Fix bug cell toolbars not redrawing on metadata change
This commit is contained in:
commit
8d9d317e91
@ -45,7 +45,18 @@ define([
|
|||||||
this.selected = false;
|
this.selected = false;
|
||||||
this.rendered = false;
|
this.rendered = false;
|
||||||
this.mode = 'command';
|
this.mode = 'command';
|
||||||
this.metadata = {};
|
|
||||||
|
// Metadata property
|
||||||
|
var that = this;
|
||||||
|
this._metadata = {};
|
||||||
|
Object.defineProperty(this, 'metadata', {
|
||||||
|
get: function() { return that._metadata; },
|
||||||
|
set: function(value) {
|
||||||
|
that._metadata = value;
|
||||||
|
that.celltoolbar.rebuild();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// load this from metadata later ?
|
// load this from metadata later ?
|
||||||
this.user_highlight = 'auto';
|
this.user_highlight = 'auto';
|
||||||
this.cm_config = config.cm_config;
|
this.cm_config = config.cm_config;
|
||||||
@ -406,7 +417,6 @@ define([
|
|||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* should be overritten by subclass
|
* should be overritten by subclass
|
||||||
* @method fromJSON
|
* @method fromJSON
|
||||||
@ -415,7 +425,6 @@ define([
|
|||||||
if (data.metadata !== undefined) {
|
if (data.metadata !== undefined) {
|
||||||
this.metadata = data.metadata;
|
this.metadata = data.metadata;
|
||||||
}
|
}
|
||||||
this.celltoolbar.rebuild();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user