diff options
Diffstat (limited to 'platform/www/lib/plugins/translation/script.js')
-rw-r--r-- | platform/www/lib/plugins/translation/script.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/platform/www/lib/plugins/translation/script.js b/platform/www/lib/plugins/translation/script.js new file mode 100644 index 0000000..819b80e --- /dev/null +++ b/platform/www/lib/plugins/translation/script.js @@ -0,0 +1,20 @@ +/** + * 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; + }); +}); |