Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(W-3550658) makes code a little more redible #2

Merged
merged 2 commits into from
Dec 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions grunt/tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
});
};
7 changes: 4 additions & 3 deletions js/pillbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down