mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
settings is fully moved to required.
This commit is contained in:
parent
73f3459264
commit
6f8c73771d
54 changed files with 533 additions and 439 deletions
38
UI/Mixins/AsNamedView.js
Normal file
38
UI/Mixins/AsNamedView.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
'use strict';
|
||||
|
||||
define(
|
||||
function () {
|
||||
|
||||
return function () {
|
||||
|
||||
this.viewName = function () {
|
||||
if (this.template) {
|
||||
var regex = new RegExp('\/', 'g');
|
||||
|
||||
return this.template
|
||||
.toLocaleLowerCase()
|
||||
.replace('template', '')
|
||||
.replace(regex, '-');
|
||||
}
|
||||
|
||||
return undefined;
|
||||
};
|
||||
|
||||
var originalOnRender = this.onRender;
|
||||
|
||||
this.onRender = function () {
|
||||
|
||||
this.$el.removeClass('iv-' + this.viewName());
|
||||
this.$el.addClass('iv-' + this.viewName());
|
||||
|
||||
if (originalOnRender) {
|
||||
return originalOnRender.call(this);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
};
|
||||
|
||||
return this;
|
||||
};
|
||||
}
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue