Merge pull request #6857 from jdfreder/celltoolbar_metadata_fix

Fix bug cell toolbars not redrawing on metadata change
This commit is contained in:
Thomas Kluyver 2014-11-14 12:57:15 -08:00
commit 8d9d317e91

View File

@ -45,7 +45,18 @@ define([
this.selected = false;
this.rendered = false;
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 ?
this.user_highlight = 'auto';
this.cm_config = config.cm_config;
@ -406,7 +417,6 @@ define([
return data;
};
/**
* should be overritten by subclass
* @method fromJSON
@ -415,7 +425,6 @@ define([
if (data.metadata !== undefined) {
this.metadata = data.metadata;
}
this.celltoolbar.rebuild();
};