1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-31 07:52:37 +01:00

ModelBoundView now blows up if there is no model.

This commit is contained in:
Keivan Beigi 2013-06-18 18:10:32 -07:00
parent 6f8c73771d
commit ba26eadd7e

View File

@ -10,10 +10,17 @@ define(
originalBeforeClose = this.prototype.onBeforeClose;
this.prototype.onRender = function () {
if (this.model) {
this._modelBinder = new ModelBinder();
this._modelBinder.bind(this.model, this.el);
if (!this.model) {
throw 'View has no model for binding';
}
if (!this._modelBinder) {
this._modelBinder = new ModelBinder();
}
this._modelBinder.bind(this.model, this.el);
if (originalOnRender) {
originalOnRender.call(this);
}