Use tabs for indention

This commit is contained in:
Christian Bünte 2014-02-19 08:11:11 +01:00
parent da6fdbb09b
commit 5d0266edad

56
javascript/CMSMain.Translatable.js Executable file → Normal file
View File

@ -40,35 +40,35 @@
var locale = {locale: $(e.target).val()};
var url = document.location.href;
// Check existing url
search = /locale=[^&]*/;
if(url.match(search)) {
// Replace locale code
url = url.replace(search, $.param(locale));
} else {
// Add locale code
url = $.path.addSearchParams(url, locale);
}
// Check existing url
search = /locale=[^&]*/;
if(url.match(search)) {
// Replace locale code
url = url.replace(search, $.param(locale));
} else {
// Add locale code
url = $.path.addSearchParams(url, locale);
}
// Get id for translation and fix redirect url
var selectedTreeItem = $('.cms-tree').jstree('get_selected');
if(selectedTreeItem.length > 0) {
selectedTreeItem = selectedTreeItem.eq(0);
$.get(
$.path.addSearchParams(this.data('translationUrl'), {
'requestedLocale': $(e.target).val(),
'id': selectedTreeItem.data('id'),
'class': selectedTreeItem.data('pagetype')
}),
function(data) {
if(data != '') {
url = data;
}
$('.cms-container').loadPanel(url);
}
);
return false;
}
// Get id for translation and fix redirect url
var selectedTreeItem = $('.cms-tree').jstree('get_selected');
if(selectedTreeItem.length > 0) {
selectedTreeItem = selectedTreeItem.eq(0);
$.get(
$.path.addSearchParams(this.data('translationUrl'), {
'requestedLocale': $(e.target).val(),
'id': selectedTreeItem.data('id'),
'class': selectedTreeItem.data('pagetype')
}),
function(data) {
if(data != '') {
url = data;
}
$('.cms-container').loadPanel(url);
}
);
return false;
}
$('.cms-container').loadPanel(url);
return false;