1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dokuwiki_ynh.git synced 2024-09-03 18:26:20 +02:00
dokuwiki_ynh/sources/lib/plugins/translation/script.js
2014-07-20 13:53:07 +02:00

20 lines
591 B
JavaScript

/**
* Remove go button from translation dropdown
*/
jQuery(function(){
var $frm = jQuery('#translation__dropdown');
if(!$frm.length) return;
$frm.find('input[name=go]').hide();
$frm.find('select[name=id]').change(function(){
var id = jQuery(this).val();
// this should hopefully detect rewriting good enough:
var action = $frm.attr('action');
if(action.substr(action.length-1) == '/'){
var link = action + id;
}else{
var link = action + '?id=' + id;
}
window.location.href= link;
});
});