mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-15 01:23:53 -07:00
fixed bootstrap switches. still need to listen to checkbox event.
This commit is contained in:
parent
d85b825e06
commit
27f45cfdee
7 changed files with 10 additions and 22 deletions
|
@ -17,15 +17,18 @@ Marionette.View.prototype.viewName = function () {
|
|||
return undefined;
|
||||
};
|
||||
|
||||
Marionette.ItemView.prototype.self$ = function (selector) {
|
||||
return this.$(selector).not("[class*='iv-'] " + selector);
|
||||
};
|
||||
|
||||
Marionette.ItemView.prototype.render = function () {
|
||||
|
||||
var result = oldItemViewRender.apply(this, arguments);
|
||||
|
||||
|
||||
|
||||
//check to see if el has bindings (name attribute)
|
||||
// any element that has a name attribute and isn't child of another view.
|
||||
if (this.$('[name]').not("[class*='iv-'] [name]").length > 0) {
|
||||
if (this.self$('[name]').length > 0) {
|
||||
if (!this.model) {
|
||||
throw 'view ' + this.viewName() + ' has binding attributes but model is not defined';
|
||||
}
|
||||
|
@ -39,7 +42,10 @@ Marionette.ItemView.prototype.render = function () {
|
|||
this._modelBinder.bind(this.model, this.el);
|
||||
}
|
||||
|
||||
this.self$('.switch').bootstrapSwitch();
|
||||
this.$el.addClass('iv-' + this.viewName());
|
||||
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue