Changeset b2e6f6c46ef217bab563f4952f6451d5109f53de

Show
Ignore:
Timestamp:
04/15/09 19:59:22 (6 years ago)
Author:
Dave Hubbard <dhubbard@omniti.com>
git-committer:
Dave Hubbard <dhubbard@omniti.com> 1239825562 +0000
git-parent:

[d074a94dcf46254414d8693352e7b8d537f6d082]

git-author:
Dave Hubbard <dhubbard@omniti.com> 1239825562 +0000
Message:

fix New Blank functionality when the current graph is unsaved

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ui/web/htdocs/graph_panel.inc

    r958caa8 rb2e6f6c  
    310310  if(id) $.getJSON("json/graph/info/" + id, refresh_graph_from_json); 
    311311  else refresh_graph_from_json({}); 
    312   $("span.blankGraph").click(function() { 
    313     if(graphinfo.saved) set_current_graph_id(''); 
    314     else if(graphinfo.saved!=undefined && graphinfo.saved==false) { 
    315          confirm("I will forget the current graph.  Are you sure?", function() { 
    316              $.getJSON('json/graph/forget/' + graphinfo.id, 
    317                function (r) { 
    318                  if(r.error) { 
    319                    $("#gtool-error").html(r.error).fadeIn('fast'); 
    320                  } 
    321                  else set_current_graph_id(''); 
    322                }); 
    323  
    324          }); 
    325     } 
    326  
    327     return false; 
    328   }); 
    329312} 
    330313--> 
     
    441424          } 
    442425        }); 
     426 
     427        $("span.blankGraph").click(function() { 
     428          // current graph is saved, so just give a new one. 
     429          if(graphinfo.saved) set_current_graph_id(''); 
     430 
     431          // otherwise make sure the user wants to move on, and if so, give a new graph and orphan the unsaved one. 
     432          else if(graphinfo.saved!=undefined && graphinfo.saved==false) { 
     433            confirm("I will forget the current graph.  Are you sure?", function() { 
     434              set_current_graph_id(''); 
     435            }); 
     436          } 
     437 
     438          return false; 
     439        }); 
     440 
    443441        set_current_graph_id(''); 
    444442        maingraph = $('<div></div>').attr("id", "maingraph").ReconGraph({graphid: graphinfo.id, width: 780, height: 400});