mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
model should automatically be bound to view.
This commit is contained in:
parent
68eada4c4d
commit
30595e85a3
22 changed files with 33 additions and 61 deletions
26
UI/Mixins/backbone.modelbinder.mixin.js
Normal file
26
UI/Mixins/backbone.modelbinder.mixin.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
'use strict';
|
||||
|
||||
var oldItemViewRender = Marionette.ItemView.prototype.render;
|
||||
var oldItemCollectionViewRender = Marionette.CollectionView.prototype.render;
|
||||
|
||||
Marionette.ItemView.prototype.render = function () {
|
||||
|
||||
if (this.model) {
|
||||
NzbDrone.ModelBinder.bind(this.model, this.el);
|
||||
}
|
||||
|
||||
console.log("render");
|
||||
|
||||
return oldItemViewRender.apply(this, arguments);
|
||||
};
|
||||
|
||||
Marionette.CollectionView.prototype.render = function () {
|
||||
|
||||
if (this.model) {
|
||||
NzbDrone.ModelBinder.bind(this.model, this.el);
|
||||
}
|
||||
|
||||
console.log("render");
|
||||
|
||||
return oldItemCollectionViewRender.apply(this, arguments);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue