1

Changing reset behavior

This commit is contained in:
Alex Yatskov 2014-11-09 13:19:45 +09:00
parent 1d49c6ac30
commit 1619616c52
2 changed files with 7 additions and 4 deletions

View File

@ -21,7 +21,6 @@
<big>Visualizer</big>
<div class="pull-right">
<button class="btn btn-xs btn-danger" id="forget">Forget</button>
<button class="btn btn-xs btn-warning" style="display: none;" id="reset">Reset</button>
<button class="btn btn-xs btn-default" id="learn">Learn</button>
</div>
</div>

View File

@ -65,10 +65,16 @@
$('#historyIndex').on('slideStop', onSelectSnapshot);
$('#learn').click(onLearn);
$('#forget').click(onForget);
$('#reset').click(onSearch);
$('#customized').click(onReset);
});
}
function onReset() {
if (confirm('Reset customizations?')) {
onSearch();
}
}
function onLearn() {
var keyword = prompt('Input keyword to learn as (alphanumeric, no spaces)');
if (keyword === null) {
@ -181,12 +187,10 @@
function setCustomized(customized) {
if (customized) {
$('#customized').show();
$('#reset').show();
$('#forget').hide();
}
else {
$('#customized').hide();
$('#reset').hide();
$('#forget').show();
}
}