Support » Plugin: Optimized Dropdown Menus » OnChange without Go button?

Viewing 1 replies (of 1 total)
  • Hi Taajuus, I ran into the same problem and came up with what I think is a fix for the situation:

    1. Go to your plugins directory and rename the plugin to my-optimized-dropdown-menus (I think this will prevent any updates from overwriting the changes you make).

    2. Then in optimized-dm.php change Plugin Name to Plugin Name: My Optimized Dropdown Menus (again trying to prevent an update overwrite).

    replace javascript in print_odm_javascript() at line 162 with:

    <script type="text/javascript">
    			/* ref: https://gist.github.com/1918689 */
    			jQuery(document).ready(function($) {
    				var $widget = $('.odm-widget');
    
    				$('ul', $widget).each(function(){
    				  var list = $(this);
    				  var select = $(document.createElement('select'))
    				          .attr('id',$(this).attr('id'))
    				          .insertBefore($(this).hide())
    						  .attr('onchange',
    				    	$widget.hasClass('odm-new-window')
    				    		? 'window.open(jQuery(\'#'+$(this).attr('id')+'\').val(), \'_blank\');'
    				    		: 'window.location.href=jQuery(\'#'+$(this).attr('id')+'\').val();');
    				  $('>li a', this).each( function(){
    				    option = $( document.createElement('option') )
    				      .appendTo(select)
    				      .val(this.href)
    				      .html( $(this).html() );
    				  });
    				  list.remove();
    
    				});
    			});
    	    </script>

    3. Go into plugins and activate My Optimized Dropdown Menus and I believe that will do what you are looking for.

    Seems to work for me, hope it works for you!

Viewing 1 replies (of 1 total)
  • The topic ‘OnChange without Go button?’ is closed to new replies.