diff --git a/grunt/tasks/test.js b/grunt/tasks/test.js index 8543a476d..4791da9ab 100644 --- a/grunt/tasks/test.js +++ b/grunt/tasks/test.js @@ -24,9 +24,9 @@ module.exports = function test (grunt) { grunt.registerTask('resetdist', 'resets changes to dist to keep them from being checked in', function resetdist () { // default resetdist to true... basically. if (typeof grunt.option('resetdist') === 'undefined' || grunt.option('resetdist')) { - var exec = require('child_process').exec; - exec('git reset HEAD dist/*'); - exec('git checkout -- dist/*'); + var exec = require('child_process').execSync; + exec('git reset HEAD dist'); + exec('git checkout -- dist'); } }); }; diff --git a/js/pillbox.js b/js/pillbox.js index 74177be56..0742765c1 100644 --- a/js/pillbox.js +++ b/js/pillbox.js @@ -357,11 +357,12 @@ var self = this; var text = self.options.cleanInput(this.$addItem.val()); var isFocusOutEvent = e.type === 'focusout'; - var addOnFocusOut = (isFocusOutEvent && text.length > 0); - + var blurredAfterInput = (isFocusOutEvent && text.length > 0); // If we test for keycode only, it will match for `<` & `,` instead of just `,` // This way users can type `<3` and `1 < 3`, etc... - if ((this.acceptKeyCodes[e.keyCode] && !isShiftHeld(e)) || addOnFocusOut) { + var acceptKeyPressed = (this.acceptKeyCodes[e.keyCode] && !isShiftHeld(e)); + + if (acceptKeyPressed || blurredAfterInput) { var attr; var value;