Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Switch from using inputs with a type of number (too restrictive, has …

…weird side-effects). Do some reformatting of the software keyboard, as well.
  • Loading branch information...
commit 0c491b01881b033e37f1745cfd9c072a6c3c6295 1 parent 537dcff
@jeresig jeresig authored
View
2  css/khan-exercise.css
@@ -294,7 +294,7 @@ div.timeline-total {
}
}
-.lite #solutionarea input[type=number] {
+.lite #solutionarea input.number {
font-size: 16px;
text-align: right;
View
2  utils/answer-types.js
@@ -392,7 +392,7 @@ jQuery.extend( Khan.answerTypes, {
var input;
if ( typeof userExercise !== "undefined" && userExercise.tablet ) {
- input = jQuery("<input type='number'/>");
+ input = jQuery("<input type='text' class='number'/>");
}
return Khan.answerTypes.text( solutionarea, solution, fallback, verifier, input );
View
17 utils/software-keyboard.js
@@ -1,17 +1,16 @@
jQuery.fn["software-keyboardPost"] = function() {
- var softwareKeyboard = jQuery( "#software-keyboard" );
- var solutionarea = jQuery("#solutionarea");
-
- var inputs = solutionarea.find( ":input" );
- inputs.prop( "readonly", true )
- .css( "-webkit-tap-highlight-color", "rgba(0, 0, 0, 0)" );
+ var softwareKeyboard = jQuery( "#software-keyboard" ),
+ solutionarea = jQuery( "#solutionarea" ),
+ inputs = solutionarea.find( ":input" )
+ .prop( "readonly", true )
+ .css( "-webkit-tap-highlight-color", "rgba(0, 0, 0, 0)" ),
+ field = inputs.first();
var keyPressed = function( key ) {
- var field = solutionarea.find( ":input" ).first();
-
// Normal key
- if ( key.length === 1 ) {
+ if ( key !== "bs" ) {
field.val( field.val() + key );
+
} else {
// Assume for now that it is backspace
field.val( field.val().slice( 0, -1 ) );
Please sign in to comment.
Something went wrong with that request. Please try again.