mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
fixed more require issues
This commit is contained in:
parent
d1c279d3cd
commit
0ae1865dd8
6 changed files with 49 additions and 44 deletions
|
@ -1,26 +1,30 @@
|
|||
"use strict";
|
||||
|
||||
define(['app', 'marionette', 'handlebars', 'templates'], function (App, Marionette, HandleBars, Templates) {
|
||||
Marionette.TemplateCache.get = function (templateId) {
|
||||
define(['templates'], function (Templates) {
|
||||
return function () {
|
||||
this.get = function (templateId) {
|
||||
|
||||
var templateKey = templateId.toLowerCase();
|
||||
var templateKey = templateId.toLowerCase();
|
||||
|
||||
var templateFunction = Templates[templateKey];
|
||||
var templateFunction = Templates[templateKey];
|
||||
|
||||
if (!templateFunction) {
|
||||
throw 'couldn\'t find pre-compiled template ' + templateKey;
|
||||
}
|
||||
|
||||
return function (data) {
|
||||
|
||||
try {
|
||||
return templateFunction(data);
|
||||
}
|
||||
catch (error) {
|
||||
console.error('template render failed for ' + templateKey + ' ' + error);
|
||||
console.error(data);
|
||||
throw error;
|
||||
if (!templateFunction) {
|
||||
throw 'couldn\'t find pre-compiled template ' + templateKey;
|
||||
}
|
||||
|
||||
return function (data) {
|
||||
|
||||
try {
|
||||
return templateFunction(data);
|
||||
}
|
||||
catch (error) {
|
||||
console.error('template render failed for ' + templateKey + ' ' + error);
|
||||
console.error(data);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue