1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-18 21:35:51 -04:00

fixed more require issues

This commit is contained in:
kay.one
2013-06-14 22:28:35 -07:00
parent d1c279d3cd
commit 0ae1865dd8
6 changed files with 49 additions and 44 deletions
+21 -17
View File
@@ -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;
}
};
};
};
});
+9 -6
View File
@@ -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);