fixed onclick binding

This commit is contained in:
Kristjan Komlosi
2020-06-02 10:45:16 +02:00
parent 00c619ce34
commit 89ea9564c8
2 changed files with 5 additions and 7 deletions
+3 -5
View File
@@ -1,7 +1,5 @@
// All code in this file is licensed under the ISC license, provided in LICENSE.txt // All code in this file is licensed under the ISC license, provided in LICENSE.txt
$('#update').click(function () { $('#update').click(updateData);
updateData();
});
// jQuery event binder // jQuery event binder
function updateData () { function updateData () {
@@ -28,8 +26,8 @@ function graphSpectralData (obj, dom) {
graphXTicks.push([i, specter[i]]); graphXTicks.push([i, specter[i]]);
} }
const options = { const options = {
grid: {color: 'white'}, grid: { color: 'white' },
xaxis: {ticks: graphXTicks} xaxis: { ticks: graphXTicks }
}; };
$.plot('#graph', [graphPoints], options); $.plot('#graph', [graphPoints], options);
// flot expects an array of arrays (lines) of 2-element arrays (points) // flot expects an array of arrays (lines) of 2-element arrays (points)
+1 -1
View File
@@ -25,7 +25,7 @@
</div> </div>
<div class="container"> <div class="container">
<button id="update" class="btn btn-primary">Get data</button> <button id="update" onclick="updateData()" class="btn btn-primary">Get data</button>
<button id="download" class="btn btn-primary">Download</button> <button id="download" class="btn btn-primary">Download</button>
<button id="debug" class="btn btn-danger">DEBUG</button> <button id="debug" class="btn btn-danger">DEBUG</button>
</div> </div>