mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-18 21:35:27 -04:00
ModelBoundView now blows up if there is no model.
This commit is contained in:
@@ -10,10 +10,17 @@ define(
|
|||||||
originalBeforeClose = this.prototype.onBeforeClose;
|
originalBeforeClose = this.prototype.onBeforeClose;
|
||||||
|
|
||||||
this.prototype.onRender = function () {
|
this.prototype.onRender = function () {
|
||||||
if (this.model) {
|
|
||||||
this._modelBinder = new ModelBinder();
|
if (!this.model) {
|
||||||
this._modelBinder.bind(this.model, this.el);
|
throw 'View has no model for binding';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this._modelBinder) {
|
||||||
|
this._modelBinder = new ModelBinder();
|
||||||
|
}
|
||||||
|
|
||||||
|
this._modelBinder.bind(this.model, this.el);
|
||||||
|
|
||||||
if (originalOnRender) {
|
if (originalOnRender) {
|
||||||
originalOnRender.call(this);
|
originalOnRender.call(this);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user