model should automatically be bound to view.

This commit is contained in:
Keivan Beigi 2013-04-10 18:24:34 -07:00
commit 30595e85a3
22 changed files with 33 additions and 61 deletions

View file

@ -1,4 +1,6 @@
define(['app'], function () {
"use strict";
define(['app'], function () {
$.fn.autoComplete = function (resource) {
$(this).typeahead({

View file

@ -1,4 +1,5 @@
//try to add ajax data as query string to DELETE calls.
"use strict";
(function () {
var original = Backbone.ajax;

View 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);
};