Skip to content

Commit

Permalink
remove support for old version
Browse files Browse the repository at this point in the history
  • Loading branch information
SylvainCorlay committed Jul 13, 2015
1 parent 466b6ec commit 474f08c
Showing 1 changed file with 9 additions and 21 deletions.
30 changes: 9 additions & 21 deletions ipywidgets/static/widgets/js/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,28 +280,16 @@ define([
/**
* Handle when a comm is opened.
*/
// For < 4.x
var model;
if (msg.content.data.model_name) {
model = this.create_model({
model_name: msg.content.data.model_name,
model_module: msg.content.data.model_module,
comm: comm,
return this.create_model({
model_name: msg.content.data._model_name,
model_module: msg.content.data._model_module,
comm: comm,
}).then(function(model) {
return model._deserialize_state(msg.content.data).then(function(state) {
model.set_state(state);
return model;
});
} else {
model = this.create_model({
model_name: msg.content.data._model_name,
model_module: msg.content.data._model_module,
comm: comm,
}).then(function(model) {
return model._deserialize_state(msg.content.data).then(function(state) {
model.set_state(state);
return model;
});
});
}

return model.catch(utils.reject("Couldn't create a model.", true));
}).catch(utils.reject("Couldn't create a model.", true));
};

WidgetManager.prototype.create_model = function (options) {
Expand Down

0 comments on commit 474f08c

Please sign in to comment.