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

Commit

Permalink
Fixed blinking messages, issue #90
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Dec 11, 2015
1 parent 474820b commit ebdd789
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 21 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-validation-ghiscoding",
"version": "1.4.15",
"version": "1.4.16",
"author": "Ghislain B.",
"description": "Angular-Validation Directive and Service (ghiscoding)",
"main": [
Expand Down
3 changes: 2 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Angular-Validation change logs

1.4.15 (2015-12-02) Fixed issue #86 implicit global variable on regex
1.4.16 (2015-12-11) Fixed issue #90 blinking error messages.
1.4.15 (2015-12-02) Fixed issue #86 implicit global variable on regex.
1.4.14 (2015-11-15) Added validation-callback (#79), added #81, #82. Added new validation-callback attribute, runs after the debounce/blur and validaiton are completed. Added possibility passing arguments to Custom & Remote validators. Added new Global Options: hideErrorUnderInputs.
1.4.13 (2015-11-04) Fixed issue #78 - 'strValue is not defined' error when using `max` auto-detect validator.
1.4.12 (2015-11-01) Fixed a small issue with pulling the form name when trying to find the parent form of an input element.
Expand Down
8 changes: 4 additions & 4 deletions dist/angular-validation.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-validation-ghiscoding",
"version": "1.4.15",
"version": "1.4.16",
"author": "Ghislain B.",
"description": "Angular-Validation Directive and Service (ghiscoding)",
"main": "app.js",
Expand Down
18 changes: 12 additions & 6 deletions protractor/badInput_spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Angular-Validation Tests:', function () {
describe('Angular-Validation badInput Tests:', function () {
// global variables
var input2error = "Must be a positive or negative number. Field is required.";
var input2invalidChar = "Invalid keyboard entry on a field of type 'number'.";
Expand Down Expand Up @@ -53,13 +53,19 @@ describe('Angular-Validation Tests:', function () {
});

it('Should show ValidationSummary after clicking on show checkbox', function() {
var btnShowSummary = $('[name=btn_showValidation]');
btnShowSummary.click();
browser.waitForAngular();

// showValidation checkbox should be false at first but true after
var elmCheckboxShowSummary = element(by.model('displayValidationSummary'));
expect(elmCheckboxShowSummary.isSelected()).toBeTruthy();
expect(elmCheckboxShowSummary.isSelected()).toBeFalsy();

// go to the bottom of the form and click on the button showValidation
browser.executeScript('window.scrollTo(0,1500);').then(function () {
var btnShowSummary = $('[name=btn_showValidation]');
btnShowSummary.click();
browser.waitForAngular();

// scroll back to top
var elmCheckboxShowSummary = element(by.model('displayValidationSummary'));
});
});

it('Should show same invalid character in ValidationSummary', function() {
Expand Down
2 changes: 1 addition & 1 deletion protractor/callback_spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Angular-Validation Remote Validation Tests:', function () {
describe('Angular-Validation callback Validation Tests:', function () {
// global variables
var formElementNames = ['firstName1', 'lastName1', 'firstName2', 'lastName2'];
var firstNameElements = ['firstName1', 'firstName2'];
Expand Down
4 changes: 2 additions & 2 deletions protractor/conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
],
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 850000
defaultTimeoutInterval: 900000
},
allScriptsTimeout: 850000,
allScriptsTimeout: 900000,
seleniumAddress: 'http://localhost:4444/wd/hub',

// format the output when tests are run with Team City
Expand Down
2 changes: 1 addition & 1 deletion protractor/full_tests_spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Angular-Validation Tests:', function () {
describe('Angular-Validation Full Tests:', function () {
// global variables
var requiredErrorMessages = {
'en': 'Field is required.',
Expand Down
2 changes: 1 addition & 1 deletion protractor/mixed_validation_spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Angular-Validation Tests:', function () {
describe('Angular-Validation Mixed Tests:', function () {
// global variables
var formElementNames = ['input2', 'input3', 'input4', 'input5', 'input6', 'input7', 'input8', 'input9', 'input10', 'input11', 'input12', 'select1', 'input13', 'input14', 'input15', 'input16', 'input17', 'input18', 'input19', 'input20', 'input21', 'area1'];
var formElementSummaryNames = ['input2', 'input3', 'input4', 'Email', 'input6', 'input7', 'Credit Card', 'input9', 'input10', 'input11', 'select1', 'input13', 'input15', 'input16', 'input17', 'input18', 'input19', 'input20', 'input21', 'area1'];
Expand Down
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Angular Validation (Directive / Service)
`Version: 1.4.15`
`Version: 1.4.16`
### Form validation after user stop typing (default 1sec).

Forms Validation with Angular made easy! Angular-Validation is an angular directive/service with locales (languages) with a very simple approach of defining your `validation=""` directly within your element to validate (input, textarea, etc) and...that's it!!! The directive/service will take care of the rest!
Expand Down Expand Up @@ -76,6 +76,7 @@ All the documentation has been moved to the Wiki section, see the [github wiki](
* [3rd Party Addon Validation](https://github.com/ghiscoding/angular-validation/wiki/3rd-Party-Addons)
* [Directive Examples](https://github.com/ghiscoding/angular-validation/wiki/Working-Directive-Examples)
* [Service Examples](https://github.com/ghiscoding/angular-validation/wiki/Working-Service-Examples)
* [Bootstrap Decorator (has-error)](https://github.com/ghiscoding/angular-validation/wiki/Bootstrap-Decorator-(has-error))
* Functionalities
* [Alternate Text on Validators](https://github.com/ghiscoding/angular-validation/wiki/Alternate-Text-on-Validators)
* [DisplayErrorTo](https://github.com/ghiscoding/angular-validation/wiki/Bootstrap-Input-Groups-Wrapping)
Expand Down
3 changes: 2 additions & 1 deletion src/validation-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
isValid = commonObj.validate(value, true);
scope.$evalAsync(ctrl.$setValidity('validation', isValid ));
deferred.resolve({ isFieldValid: isValid, formElmObj: formElmObj, value: value });
$timeout.cancel(_timer);
}else {
// Start validation only after the user has stopped typing in a field
// everytime a new character is typed, it will cancel/restart the timer & we'll erase any error mmsg
Expand Down Expand Up @@ -258,7 +259,7 @@

if (!formElmObj.isValidationCancelled) {
// attempt to validate & run validation callback if user requested it
var validationPromise = attemptToValidate(value, 10);
var validationPromise = attemptToValidate(value, 0);
if(!!_validationCallback) {
commonObj.runValidationCallbackOnPromise(validationPromise, _validationCallback);
}
Expand Down
3 changes: 2 additions & 1 deletion src/validation-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ angular
self.commonObj.initialize(scope, attrs.elm, attrs, attrs.ctrl);

// attempt to validate & run validation callback if user requested it
var validationPromise = attemptToValidate(self, event.target.value, 10);
var validationPromise = attemptToValidate(self, event.target.value, 0);
if(!!_validationCallback) {
self.commonObj.runValidationCallbackOnPromise(validationPromise, _validationCallback);
}
Expand Down Expand Up @@ -402,6 +402,7 @@ angular
isValid = self.commonObj.validate(value, true);
self.commonObj.scope.$evalAsync(self.commonObj.ctrl.$setValidity('validation', isValid ));
deferred.resolve({ isFieldValid: isValid, formElmObj: formElmObj, value: value });
$timeout.cancel(self.timer);
}else {
// Make the validation only after the user has stopped activity on a field
// everytime a new character is typed, it will cancel/restart the timer & we'll erase any error mmsg
Expand Down

0 comments on commit ebdd789

Please sign in to comment.