Finished adding error handling.

pull/37/head
Jonathan Frederic 12 years ago
parent 1d1572421f
commit c67dcc0dc3

@ -97,7 +97,7 @@ define(["widgets/js/manager",
} finally {
that.state_lock = null;
}
}, $.proxy(console.error, console));
}, utils.reject("Couldn't set model state", true));
},
_handle_status: function (msg, callbacks) {
@ -259,9 +259,9 @@ define(["widgets/js/manager",
});
return Promise.all(unpacked);
} else if (value instanceof Object) {
var unpacked = {};
unpacked = {};
_.each(value, function(sub_value, key) {
unpacked[key] = that._unpack_models(sub_value)
unpacked[key] = that._unpack_models(sub_value);
});
return utils.resolve_dict(unpacked);
} else if (typeof value === 'string' && value.slice(0,10) === "IPY_MODEL_") {

@ -78,13 +78,14 @@ define([
var that = this;
var dummy = $('<div/>');
that.$box.append(dummy);
this.create_child_view(model).then(function(view) {
return this.create_child_view(model).then(function(view) {
dummy.replaceWith(view.el);
// Trigger the displayed event of the child view.
that.after_displayed(function() {
view.trigger('displayed');
});
return view;
}, utils.reject("Couldn't add child view to box", true));
},
});

@ -116,7 +116,7 @@ define([
var dummy = $('<div/>');
accordion_inner.append(dummy);
this.create_child_view(model).then(function(view) {
return this.create_child_view(model).then(function(view) {
dummy.replaceWith(view.$el);
that.update();
that.update_titles();
@ -125,7 +125,8 @@ define([
that.after_displayed(function() {
view.trigger('displayed');
});
}, $.proxy(console.error, console));
return view;
}, utils.reject("Couldn't add child view to box", true));
},
});
@ -210,7 +211,7 @@ define([
.append(dummy)
.appendTo(that.$tab_contents);
this.create_child_view(model).then(function(view) {
return this.create_child_view(model).then(function(view) {
dummy.replaceWith(view.$el);
view.parent_tab = tab;
view.parent_container = contents_div;
@ -219,7 +220,8 @@ define([
that.after_displayed(function() {
view.trigger('displayed');
});
}, $.proxy(console.error, console));
return view;
}, utils.reject("Couldn't add child view to box", true));
},
update: function(options) {

Loading…
Cancel
Save