Skip to content

Commit 81e1298

Browse files
committed
Add a button for deleting a profile point
1 parent a2b3071 commit 81e1298

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

public/assets/js/picoreflow.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ function updateProgress(percentage)
102102
}
103103
}
104104

105+
function deletePoint(i) {
106+
console.log('deleting', i)
107+
graph.profile.data.splice(i, 1);
108+
updateProfileTable();
109+
}
110+
105111
function updateProfileTable()
106112
{
107113
var dps = 0;
@@ -123,7 +129,7 @@ function updateProfileTable()
123129
html += '<td><input type="text" class="form-control" id="profiletable-0-'+i+'" value="'+ timeProfileFormatter(graph.profile.data[i][0],true) + '" style="width: 60px" /></td>';
124130
html += '<td><input type="text" class="form-control" id="profiletable-1-'+i+'" value="'+ graph.profile.data[i][1] + '" style="width: 60px" /></td>';
125131
html += '<td><div class="input-group"><span class="glyphicon glyphicon-circle-arrow-' + slope + ' input-group-addon ds-trend" style="background: '+color+'"></span><input type="text" class="form-control ds-input" readonly value="' + formatDPS(dps) + '" style="width: 100px" /></div></td>';
126-
html += '<td>&nbsp;</td></tr>';
132+
html += '<td><button type="button" class="btn btn-danger" onclick="deletePoint('+i+')"><span class="glyphicon glyphicon-trash"></span></button></td></tr>';
127133
}
128134

129135
html += '</table></div>';

0 commit comments

Comments
 (0)