fixed onclick binding
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
+2
-2
@@ -25,11 +25,11 @@
|
|||||||
</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>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
|
|||||||
Reference in New Issue
Block a user