mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
Use tabs for indention
This commit is contained in:
parent
da6fdbb09b
commit
5d0266edad
56
javascript/CMSMain.Translatable.js
Executable file → Normal file
56
javascript/CMSMain.Translatable.js
Executable file → Normal 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;
|
||||
|
Loading…
Reference in New Issue
Block a user