Auto hide button add_to_chart when no data plotted.

pull/68/head
Mokaddem 2016-08-23 12:09:41 +02:00
parent e59b7c4e47
commit a64d447b7b
1 changed files with 5 additions and 1 deletions

View File

@ -130,6 +130,7 @@
/* Create the slider and button*/
$('#plot-btn-add').hide();
var today = Date.now();
var old_day = today - (12*31*24*60*60)*1000;
$( ".sliderRange" ).slider({
@ -150,7 +151,9 @@
$('#plot-btn-add').click(addData);
$("#TermInput").val($("#TermInput").attr("data-init-plot"));
$("#plot-btn").click();
if($("#TermInput").attr("data-init-plot") != "") {
$("#plot-btn").click();
}
$("#TermInput").keyup(function(event){
if(event.keyCode == 13){
@ -192,6 +195,7 @@ var graph_options = {
function plotData() {
$('#plot-btn-add').show("fast");
var curthis = $(this);
var term = $('#TermInput').val();
var range_start = new Date($( ".sliderRange" ).slider( "values", 0 )).getTime() / 1000;