refresh gnuplot graph without page reload
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 12 Aug 2012 17:38:04 +0000 (19:38 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 12 Aug 2012 17:38:04 +0000 (19:38 +0200)
templates/data/items.html.ep

index 8a73e01..bdefbf2 100644 (file)
@@ -109,7 +109,11 @@ $(document).ready( function(){
        });
        $('select[name=with]').change( function(){
                console.debug( 'with', this );
-               $(this).closest('form').submit();
+               $('img#gnuplot').attr( 'src', '/gnuplot?' + $('form.info').serialize() );
+       });
+       $('ul input[name=gnuplot_hide]').change( function(){
+               console.debug( 'gnuplot_hide', this );
+               $('img#gnuplot').attr( 'src', '/gnuplot?' + $('form.info').serialize() );
        });
 });
 </script>