You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/UI/Mixins/AsNamedView.js

39 lines
887 B

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