Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

jqueryfied the javascript

  • Loading branch information...
commit 9c7d2c3210987abefa0930141b987fc8bb5f0555 1 parent 3ece9cc
@splitbrain authored
Showing with 10 additions and 9 deletions.
  1. +10 −9 script.js
View
19 script.js
@@ -1,17 +1,18 @@
/**
* Remove go button from translation dropdown
*/
-addInitEvent(function(){
- var frm = $('translation__dropdown');
- if(!frm) return;
- frm.elements['go'].style.display = 'none';
- addEvent(frm.elements['id'],'change',function(e){
- var id = e.target.options[e.target.selectedIndex].value;
+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:
- if(frm.action.substr(frm.action.length-1) == '/'){
- var link = frm.action + id;
+ var action = $frm.attr('action');
+ if(action.substr(action.length-1) == '/'){
+ var link = action + id;
}else{
- var link = frm.action + '?id=' + id;
+ var link = action + '?id=' + id;
}
window.location.href= link;
Please sign in to comment.
Something went wrong with that request. Please try again.