Use own location as API href.

This commit is contained in:
Lars Jung 2015-05-13 01:16:21 +02:00
parent 0f72db1961
commit 4f83c95d20
3 changed files with 15 additions and 31 deletions

View file

@ -1,28 +1,22 @@
modulejs.define('boot', ['$'], function ($) {
modulejs.define('boot', ['$', 'core/server'], function ($, server) {
if ($('html').hasClass('no-browser')) {
return;
}
var module = $('script[data-module]').data('module');
var data = {action: 'get', setup: true, options: true, types: true, theme: true, langs: true};
var href;
var data = {action: 'get', setup: true, options: true, types: true};
if (module === 'index') {
href = '.';
data.theme = true;
data.langs = true;
} else if (module === 'info') {
data.refresh = true;
href = 'index.php';
} else {
return;
}
$.ajax({
url: href,
data: data,
type: 'post',
dataType: 'json'
}).done(function (config) {
server.request(data, function (config) {
modulejs.define('config', config);
$(function () { modulejs.require('main/' + module); });