Skip to content

Commit 6e1b1fe

Browse files
committed
Check if base val is numeric
1 parent 8b21171 commit 6e1b1fe

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

js/script.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ $(document).ready(function() {
1616
});
1717

1818
$('.base_size').bind("change paste keyup", function() {
19-
baseSize = $(this).val() / 16;
19+
if($.isNumeric($(this).val())){
20+
baseSize = $(this).val() / 16;
21+
}
22+
else {
23+
baseSize = 0;
24+
};
2025
$('.base_em').text(Math.round(baseSize*1000)/1000);
2126
scaleSelect();
2227
});

script.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)