mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-25 01:06:30 +00:00
added view name as class to DOM element for easier debugging.
This commit is contained in:
parent
30595e85a3
commit
19dfd49ad3
1 changed files with 16 additions and 4 deletions
|
@ -3,13 +3,27 @@
|
|||
var oldItemViewRender = Marionette.ItemView.prototype.render;
|
||||
var oldItemCollectionViewRender = Marionette.CollectionView.prototype.render;
|
||||
|
||||
|
||||
Marionette.View.prototype.viewName = function () {
|
||||
if (this.template) {
|
||||
var regex = new RegExp('\/', 'g');
|
||||
|
||||
return this.template
|
||||
.toLocaleLowerCase()
|
||||
.replace('template','')
|
||||
.replace(regex, '-');
|
||||
}
|
||||
|
||||
return undefined;
|
||||
};
|
||||
|
||||
Marionette.ItemView.prototype.render = function () {
|
||||
|
||||
if (this.model) {
|
||||
NzbDrone.ModelBinder.bind(this.model, this.el);
|
||||
}
|
||||
|
||||
console.log("render");
|
||||
this.$el.addClass('iv-' + this.viewName());
|
||||
|
||||
return oldItemViewRender.apply(this, arguments);
|
||||
};
|
||||
|
@ -20,7 +34,5 @@ Marionette.CollectionView.prototype.render = function () {
|
|||
NzbDrone.ModelBinder.bind(this.model, this.el);
|
||||
}
|
||||
|
||||
console.log("render");
|
||||
|
||||
return oldItemCollectionViewRender.apply(this, arguments);
|
||||
};
|
||||
};
|
Loading…
Reference in a new issue