Comparing version 1.0.1 to 1.1.0
@@ -1910,3 +1910,2 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Dominar = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
validateOnSubmit: true, | ||
disableSubmit: false, | ||
triggers: ['keyup', 'focusout', 'change'] | ||
@@ -2078,20 +2077,2 @@ }, | ||
/** | ||
* Get the disable submit element. | ||
* | ||
* @return {element|undefined} | ||
*/ | ||
_getDisableSubmitElement: function() { | ||
if (this.config.disableSubmit === false) { | ||
return; | ||
} | ||
if (this.config.disableSubmit === true) { | ||
return Utils.$('input[type=submit], button[type=submit]'); | ||
} | ||
return Utils.$(this.disableSubmit); | ||
}, | ||
/** | ||
* Fired submit event | ||
@@ -2108,10 +2089,3 @@ * | ||
var submitPassed = function() { event.target.submit(); }; | ||
var submitFailed = function() { | ||
var submitElement = dominar._getDisableSubmitElement(); | ||
if (submitElement) { | ||
submitElement.setAttribute('disabled', 'disabled'); | ||
} | ||
dominar._trigger('SubmitFailed'); | ||
}; | ||
var submitFailed = function() { dominar._trigger('SubmitFailed'); }; | ||
var submit = function() { | ||
@@ -2118,0 +2092,0 @@ dominar.validateAll(function() { |
@@ -509,3 +509,2 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Dominar = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
validateOnSubmit: true, | ||
disableSubmit: false, | ||
triggers: ['keyup', 'focusout', 'change'] | ||
@@ -677,20 +676,2 @@ }, | ||
/** | ||
* Get the disable submit element. | ||
* | ||
* @return {element|undefined} | ||
*/ | ||
_getDisableSubmitElement: function() { | ||
if (this.config.disableSubmit === false) { | ||
return; | ||
} | ||
if (this.config.disableSubmit === true) { | ||
return Utils.$('input[type=submit], button[type=submit]'); | ||
} | ||
return Utils.$(this.disableSubmit); | ||
}, | ||
/** | ||
* Fired submit event | ||
@@ -707,10 +688,3 @@ * | ||
var submitPassed = function() { event.target.submit(); }; | ||
var submitFailed = function() { | ||
var submitElement = dominar._getDisableSubmitElement(); | ||
if (submitElement) { | ||
submitElement.setAttribute('disabled', 'disabled'); | ||
} | ||
dominar._trigger('SubmitFailed'); | ||
}; | ||
var submitFailed = function() { dominar._trigger('SubmitFailed'); }; | ||
var submit = function() { | ||
@@ -717,0 +691,0 @@ dominar.validateAll(function() { |
{ | ||
"name": "dominar", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Lighweight and highly configurable bootstrap validator", | ||
@@ -5,0 +5,0 @@ "author": "Gary Green", |
@@ -159,6 +159,2 @@ Dominar | ||
### Disable submit when failing validation | ||
Just set the `disableSubmit` config option on dominar. It can either be `true`, `false` or a selector-string to disable e.g. `.my-btn-to-disable` | ||
### Changing default options | ||
@@ -197,3 +193,2 @@ | ||
validateOnSubmit | boolean | Whether to validate the form on submit. | ||
disableSubmit | boolean, string | Whether to disable the submit button when validation is failing. String indicates selector. | ||
@@ -200,0 +195,0 @@ ## Events |
@@ -50,3 +50,2 @@ /*! | ||
validateOnSubmit: true, | ||
disableSubmit: false, | ||
triggers: ['keyup', 'focusout', 'change'] | ||
@@ -218,20 +217,2 @@ }, | ||
/** | ||
* Get the disable submit element. | ||
* | ||
* @return {element|undefined} | ||
*/ | ||
_getDisableSubmitElement: function() { | ||
if (this.config.disableSubmit === false) { | ||
return; | ||
} | ||
if (this.config.disableSubmit === true) { | ||
return Utils.$('input[type=submit], button[type=submit]'); | ||
} | ||
return Utils.$(this.disableSubmit); | ||
}, | ||
/** | ||
* Fired submit event | ||
@@ -248,10 +229,3 @@ * | ||
var submitPassed = function() { event.target.submit(); }; | ||
var submitFailed = function() { | ||
var submitElement = dominar._getDisableSubmitElement(); | ||
if (submitElement) { | ||
submitElement.setAttribute('disabled', 'disabled'); | ||
} | ||
dominar._trigger('SubmitFailed'); | ||
}; | ||
var submitFailed = function() { dominar._trigger('SubmitFailed'); }; | ||
var submit = function() { | ||
@@ -258,0 +232,0 @@ dominar.validateAll(function() { |
@@ -43,3 +43,2 @@ var expect = window.chai.expect; | ||
validateOnSubmit: true, | ||
disableSubmit: false, | ||
triggers: ['keyup', 'focusout', 'change'] | ||
@@ -46,0 +45,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
127914
4298
218