From a33e42053ecf1f62e5492afbcf5aa47dcd11e1fa Mon Sep 17 00:00:00 2001 From: Emrys Date: Mon, 20 May 2019 20:12:42 +0100 Subject: [PATCH] added all graph id to sidebar dropdown showing selected graph id removed unwanted console.log() --- Views/sidebar.php | 2 +- graph.js | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Views/sidebar.php b/Views/sidebar.php index 26a5db0..675439e 100644 --- a/Views/sidebar.php +++ b/Views/sidebar.php @@ -9,7 +9,7 @@
:
- : + : diff --git a/graph.js b/graph.js index 566f25e..09e7466 100644 --- a/graph.js +++ b/graph.js @@ -414,7 +414,7 @@ function graph_init_editor() $("body").on("click keyup",".tagheading",function(event){ let enterKey = 13; - console.log(event.type,event.which); + // console.log(event.type,event.which); if((event.type === 'keyup' && event.which === enterKey) || event.type === 'click') { var tag = $(this).data("tag"); @@ -1269,6 +1269,8 @@ function histogram(feedid,type,resolution) //---------------------------------------------------------------------------------------- $("#graph-select").change(function() { var name = $(this).val(); + var id = $(this).find(':selected').data('id'); + $('#graph-id').text(id); load_saved_graph(name); }); @@ -1421,10 +1423,11 @@ function graph_load_savedgraphs(fn=false) success: function(result) { savedgraphs = result.user; - var out = ""; + var out = ""; for (var z in savedgraphs) { - var name = savedgraphs[z].name; - out += ""; + var id = savedgraphs[z].id; + var name = savedgraphs[z].name; + out += ''; } $("#graph-select").html(out); if (fn) fn();