summaryrefslogtreecommitdiff
path: root/platform/www/lib/plugins/translation/script.js
blob: 819b80eb7deffd0c79f4057065cb0a77ff2b3851 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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;
    });
});