Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Commit

Permalink
♨️ 0.11.7 ♨️
Browse files Browse the repository at this point in the history
  • Loading branch information
1000hz committed Dec 5, 2016
1 parent 1ae1440 commit 8bcbbda
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
Changelog
=========
### 0.11.7
* Skip auto-validation of fields with errors that were set before plugin init. (#401)
* Fixing non-multiple select validation, which accidentally broke in the last release. (#453)

### 0.11.6
* Scope `focus` option's error scrolling to only inputs within the validator's form element. (#385)
* Fixing `<select multiple required />` being marked as invalid by default with jQuery 3.x (#393)
Expand Down
11 changes: 7 additions & 4 deletions dist/validator.js
@@ -1,5 +1,5 @@
/*!
* Validator v0.11.6 for Bootstrap 3, by @1000hz
* Validator v0.11.7 for Bootstrap 3, by @1000hz
* Copyright 2016 Cina Saffary
* Licensed under http://opensource.org/licenses/MIT
*
Expand All @@ -15,7 +15,7 @@
function getValue($el) {
return $el.is('[type="checkbox"]') ? $el.prop('checked') :
$el.is('[type="radio"]') ? !!$('[name="' + $el.attr('name') + '"]:checked').length :
$el.is('select') ? +$el.val() ? $el.val() : null :
$el.is('select[multiple]') ? +$el.val() ? $el.val() : null :
$el.val()
}

Expand All @@ -42,13 +42,16 @@
})
})

this.$inputs.filter(function () { return getValue($(this)) }).trigger('focusout')
// run validators for fields with values, but don't clobber server-side errors
this.$inputs.filter(function () {
return getValue($(this)) && !$(this).closest('.has-error').length
}).trigger('focusout')

this.$element.attr('novalidate', true) // disable automatic native validation
this.toggleSubmit()
}

Validator.VERSION = '0.11.6'
Validator.VERSION = '0.11.7'

Validator.INPUT_SELECTOR = ':input:not([type="hidden"], [type="submit"], [type="reset"], button)'

Expand Down
4 changes: 2 additions & 2 deletions dist/validator.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions docs/dist/validator.js
@@ -1,5 +1,5 @@
/*!
* Validator v0.11.6 for Bootstrap 3, by @1000hz
* Validator v0.11.7 for Bootstrap 3, by @1000hz
* Copyright 2016 Cina Saffary
* Licensed under http://opensource.org/licenses/MIT
*
Expand All @@ -15,7 +15,7 @@
function getValue($el) {
return $el.is('[type="checkbox"]') ? $el.prop('checked') :
$el.is('[type="radio"]') ? !!$('[name="' + $el.attr('name') + '"]:checked').length :
$el.is('select') ? +$el.val() ? $el.val() : null :
$el.is('select[multiple]') ? +$el.val() ? $el.val() : null :
$el.val()
}

Expand All @@ -42,13 +42,16 @@
})
})

this.$inputs.filter(function () { return getValue($(this)) }).trigger('focusout')
// run validators for fields with values, but don't clobber server-side errors
this.$inputs.filter(function () {
return getValue($(this)) && !$(this).closest('.has-error').length
}).trigger('focusout')

this.$element.attr('novalidate', true) // disable automatic native validation
this.toggleSubmit()
}

Validator.VERSION = '0.11.6'
Validator.VERSION = '0.11.7'

Validator.INPUT_SELECTOR = ':input:not([type="hidden"], [type="submit"], [type="reset"], button)'

Expand Down

0 comments on commit 8bcbbda

Please sign in to comment.