mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-18 21:34:28 -04:00
UI dependency graph cleanup
This commit is contained in:
25
src/UI/Require/require.api.js
Normal file
25
src/UI/Require/require.api.js
Normal file
@@ -0,0 +1,25 @@
|
||||
define(function () {
|
||||
'use strict';
|
||||
return {
|
||||
load: function (name, parentRequire, onload, config) {
|
||||
|
||||
if(config.isBuild){
|
||||
return onload();
|
||||
}
|
||||
|
||||
var resource = name.split('!')[0];
|
||||
var url = window.NzbDrone.ApiRoot + '/' + resource;
|
||||
|
||||
$.ajax({
|
||||
url: url
|
||||
}).done(function (data) {
|
||||
onload(data);
|
||||
}).error(function (xhr, status, error) {
|
||||
onload.error({
|
||||
xhr : xhr,
|
||||
status: status,
|
||||
error : error});
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user