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

Commit

Permalink
v0.11.1 still 🔛 🔝
Browse files Browse the repository at this point in the history
  • Loading branch information
1000hz committed Jul 16, 2016
1 parent 618f0e9 commit bc9fd40
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
Changelog
=========
### 0.11.1
* Added a `reset` event listener on the form to reinitialize the plugin.
* Fixed a missed bit of cleanup in `.validator('destroy')` where it wasn't removing the `.has-success` class.

### 0.11.0
###### BREAKING CHANGES:
* Custom validators are now expected to return an error string if the field is invalid.
Expand Down
17 changes: 14 additions & 3 deletions dist/validator.js
@@ -1,5 +1,5 @@
/*!
* Validator v0.11.0 for Bootstrap 3, by @1000hz
* Validator v0.11.1 for Bootstrap 3, by @1000hz
* Copyright 2016 Cina Saffary
* Licensed under http://opensource.org/licenses/MIT
*
Expand Down Expand Up @@ -30,6 +30,7 @@

this.$element.on('input.bs.validator change.bs.validator focusout.bs.validator', $.proxy(this.onInput, this))
this.$element.on('submit.bs.validator', $.proxy(this.onSubmit, this))
this.$element.on('reset.bs.validator', $.proxy(this.onReset, this))

this.$element.find('[data-match]').each(function () {
var $this = $(this)
Expand All @@ -46,7 +47,7 @@
this.toggleSubmit()
}

Validator.VERSION = '0.11.0'
Validator.VERSION = '0.11.1'

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

Expand Down Expand Up @@ -283,6 +284,16 @@
this.$btn.toggleClass('disabled', this.isIncomplete() || this.hasErrors())
}

Validator.prototype.onReset = function (e) {
var self = this
var options = this.options

window.setTimeout(function () {
self.destroy()
Plugin.call(self.$element, options)
}, 0)
}

Validator.prototype.defer = function ($el, callback) {
callback = $.proxy(callback, this, $el)
if (!this.options.delay) return callback()
Expand Down Expand Up @@ -318,7 +329,7 @@

this.$element.find('input[type="submit"], button[type="submit"]').removeClass('disabled')

this.$element.find('.has-error, .has-danger').removeClass('has-error has-danger')
this.$element.find('.has-error, .has-danger, .has-success').removeClass('has-error has-danger has-success')

return this
}
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.

17 changes: 14 additions & 3 deletions docs/dist/validator.js
@@ -1,5 +1,5 @@
/*!
* Validator v0.11.0 for Bootstrap 3, by @1000hz
* Validator v0.11.1 for Bootstrap 3, by @1000hz
* Copyright 2016 Cina Saffary
* Licensed under http://opensource.org/licenses/MIT
*
Expand Down Expand Up @@ -30,6 +30,7 @@

this.$element.on('input.bs.validator change.bs.validator focusout.bs.validator', $.proxy(this.onInput, this))
this.$element.on('submit.bs.validator', $.proxy(this.onSubmit, this))
this.$element.on('reset.bs.validator', $.proxy(this.onReset, this))

this.$element.find('[data-match]').each(function () {
var $this = $(this)
Expand All @@ -46,7 +47,7 @@
this.toggleSubmit()
}

Validator.VERSION = '0.11.0'
Validator.VERSION = '0.11.1'

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

Expand Down Expand Up @@ -283,6 +284,16 @@
this.$btn.toggleClass('disabled', this.isIncomplete() || this.hasErrors())
}

Validator.prototype.onReset = function (e) {
var self = this
var options = this.options

window.setTimeout(function () {
self.destroy()
Plugin.call(self.$element, options)
}, 0)
}

Validator.prototype.defer = function ($el, callback) {
callback = $.proxy(callback, this, $el)
if (!this.options.delay) return callback()
Expand Down Expand Up @@ -318,7 +329,7 @@

this.$element.find('input[type="submit"], button[type="submit"]').removeClass('disabled')

this.$element.find('.has-error, .has-danger').removeClass('has-error has-danger')
this.$element.find('.has-error, .has-danger, .has-success').removeClass('has-error has-danger has-success')

return this
}
Expand Down

0 comments on commit bc9fd40

Please sign in to comment.