Skip to content

Commit 0c63b88

Browse files
Adding a submit button to explicitly trigger parsing instead of occurring on change of the input box.
1 parent 31f9b84 commit 0c63b88

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@
5959
<div class="container">
6060
<form class="form-horizontal js-input-form">
6161
<label for="input">Expression to parse</label>
62-
<textarea class="form-control js-tutorial-input" id="input" placeholder="Enter your expression"></textarea>
62+
<div class="input-group">
63+
<textarea class="form-control js-tutorial-input" id="input" placeholder="Enter your expression"></textarea>
64+
<span class="input-group-btn">
65+
<button type="button" class="btn btn-primary btn-lg js-submit">Submit</button>
66+
</span>
67+
</div>
6368
</form>
6469
</div>
6570
</div>

js/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,15 @@ define(function(require, exports, module) {
131131

132132
$(function() {
133133
var $input = $('#input'),
134+
$submit = $('.js-submit'),
134135
$inputForm = $('.js-input-form'),
135136
$introText = $('.js-intro-text'),
136137
$alertMixedOperators = $('.js-alert-mixed-operators'),
137138
$truthTable = $('.js-truth-table'),
138139
$startTutorial = $('.js-tutorial-start'),
139140
lastTutorialStepNum = null;
140141

141-
$input.change(function() {
142+
$submit.on('click keypress', function() {
142143
var input = $input.val(),
143144
expression, columnClasses;
144145

0 commit comments

Comments
 (0)