mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 05:23:31 -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;
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -98,12 +98,15 @@
|
|||
return finalObj;
|
||||
};
|
||||
|
||||
_.mixin({
|
||||
deepClone: deepClone,
|
||||
isBasicObject: isBasicObject,
|
||||
basicObjects: basicObjects,
|
||||
arrays: arrays,
|
||||
deepExtend: deepExtend
|
||||
require(['underscore'], function (_) {
|
||||
|
||||
_.mixin({
|
||||
deepClone : deepClone,
|
||||
isBasicObject: isBasicObject,
|
||||
basicObjects : basicObjects,
|
||||
arrays : arrays,
|
||||
deepExtend : deepExtend
|
||||
});
|
||||
});
|
||||
|
||||
}).call(this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue