Show
Ignore:
Timestamp:
12/01/08 21:06:14 (5 years ago)
Author:
Umar Farooq <umar@omniti.com>
git-committer:
Umar Farooq <umar@omniti.com> 1228165574 +0000
git-parent:

[7c1da69d5548f5013b5997788fb466016d802483]

git-author:
Umar Farooq <umar@omniti.com> 1228165574 +0000
Message:

force new graph dialog now works, any only on unsaved, new blank graphs

Files:

Legend:

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

    re13f962 r9bac9ef  
    1414 
    1515function set_current_graph_id(id) { 
     16  if(id!='')  graphinfo.saved = true; 
    1617  current_graph_id = id; 
    1718  fetch_graph_info(current_graph_id); 
     
    2829           graphinfo.id = d.id; 
    2930           if(d.error) $("#gtool-error").html(d.error).fadeIn('fast'); 
    30            else $("#gtool-error").fadeOut('fast'); 
     31           else $("#gtool-error").fadeOut('fast');       
    3132           if(graphinfo.id && graphinfo.saved != true && 
    3233              $(".rememberGraph:visible").length == 0) { 
     34              graphinfo.saved=false; 
    3335             $(".rememberGraph").html('"Remember" this graph.').fadeIn('slow'); 
    3436             $(".rememberGraph").click(function() { 
     
    192194  else refresh_graph_from_json({}); 
    193195  $("span.blankGraph").click(function() { 
    194     if(graphinfo.saved || confirm("I will forget the current graph.  Are you sure?")) 
    195       set_current_graph_id(''); 
     196    if(graphinfo.saved) set_current_graph_id(''); 
     197    else if(graphinfo.saved!=undefined && graphinfo.saved==false) { 
     198         confirm("I will forget the current graph.  Are you sure?", function() { 
     199             set_current_graph_id(''); 
     200         }); 
     201    } 
    196202    return false; 
    197203  });