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

Commit ebdd789

Browse files
committed
Fixed blinking messages, issue #90
1 parent 474820b commit ebdd789

12 files changed

+31
-21
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-validation-ghiscoding",
3-
"version": "1.4.15",
3+
"version": "1.4.16",
44
"author": "Ghislain B.",
55
"description": "Angular-Validation Directive and Service (ghiscoding)",
66
"main": [

changelog.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Angular-Validation change logs
22

3-
1.4.15 (2015-12-02) Fixed issue #86 implicit global variable on regex
3+
1.4.16 (2015-12-11) Fixed issue #90 blinking error messages.
4+
1.4.15 (2015-12-02) Fixed issue #86 implicit global variable on regex.
45
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.
56
1.4.13 (2015-11-04) Fixed issue #78 - 'strValue is not defined' error when using `max` auto-detect validator.
67
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.

dist/angular-validation.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-validation-ghiscoding",
3-
"version": "1.4.15",
3+
"version": "1.4.16",
44
"author": "Ghislain B.",
55
"description": "Angular-Validation Directive and Service (ghiscoding)",
66
"main": "app.js",

protractor/badInput_spec.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
describe('Angular-Validation Tests:', function () {
1+
describe('Angular-Validation badInput Tests:', function () {
22
// global variables
33
var input2error = "Must be a positive or negative number. Field is required.";
44
var input2invalidChar = "Invalid keyboard entry on a field of type 'number'.";
@@ -53,13 +53,19 @@ describe('Angular-Validation Tests:', function () {
5353
});
5454

5555
it('Should show ValidationSummary after clicking on show checkbox', function() {
56-
var btnShowSummary = $('[name=btn_showValidation]');
57-
btnShowSummary.click();
58-
browser.waitForAngular();
59-
6056
// showValidation checkbox should be false at first but true after
6157
var elmCheckboxShowSummary = element(by.model('displayValidationSummary'));
62-
expect(elmCheckboxShowSummary.isSelected()).toBeTruthy();
58+
expect(elmCheckboxShowSummary.isSelected()).toBeFalsy();
59+
60+
// go to the bottom of the form and click on the button showValidation
61+
browser.executeScript('window.scrollTo(0,1500);').then(function () {
62+
var btnShowSummary = $('[name=btn_showValidation]');
63+
btnShowSummary.click();
64+
browser.waitForAngular();
65+
66+
// scroll back to top
67+
var elmCheckboxShowSummary = element(by.model('displayValidationSummary'));
68+
});
6369
});
6470

6571
it('Should show same invalid character in ValidationSummary', function() {

protractor/callback_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
describe('Angular-Validation Remote Validation Tests:', function () {
1+
describe('Angular-Validation callback Validation Tests:', function () {
22
// global variables
33
var formElementNames = ['firstName1', 'lastName1', 'firstName2', 'lastName2'];
44
var firstNameElements = ['firstName1', 'firstName2'];

protractor/conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
],
3737
jasmineNodeOpts: {
3838
showColors: true,
39-
defaultTimeoutInterval: 850000
39+
defaultTimeoutInterval: 900000
4040
},
41-
allScriptsTimeout: 850000,
41+
allScriptsTimeout: 900000,
4242
seleniumAddress: 'http://localhost:4444/wd/hub',
4343

4444
// format the output when tests are run with Team City

protractor/full_tests_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
describe('Angular-Validation Tests:', function () {
1+
describe('Angular-Validation Full Tests:', function () {
22
// global variables
33
var requiredErrorMessages = {
44
'en': 'Field is required.',

protractor/mixed_validation_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
describe('Angular-Validation Tests:', function () {
1+
describe('Angular-Validation Mixed Tests:', function () {
22
// global variables
33
var formElementNames = ['input2', 'input3', 'input4', 'input5', 'input6', 'input7', 'input8', 'input9', 'input10', 'input11', 'input12', 'select1', 'input13', 'input14', 'input15', 'input16', 'input17', 'input18', 'input19', 'input20', 'input21', 'area1'];
44
var formElementSummaryNames = ['input2', 'input3', 'input4', 'Email', 'input6', 'input7', 'Credit Card', 'input9', 'input10', 'input11', 'select1', 'input13', 'input15', 'input16', 'input17', 'input18', 'input19', 'input20', 'input21', 'area1'];

readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Angular Validation (Directive / Service)
2-
`Version: 1.4.15`
2+
`Version: 1.4.16`
33
### Form validation after user stop typing (default 1sec).
44

55
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!
@@ -76,6 +76,7 @@ All the documentation has been moved to the Wiki section, see the [github wiki](
7676
* [3rd Party Addon Validation](https://github.com/ghiscoding/angular-validation/wiki/3rd-Party-Addons)
7777
* [Directive Examples](https://github.com/ghiscoding/angular-validation/wiki/Working-Directive-Examples)
7878
* [Service Examples](https://github.com/ghiscoding/angular-validation/wiki/Working-Service-Examples)
79+
* [Bootstrap Decorator (has-error)](https://github.com/ghiscoding/angular-validation/wiki/Bootstrap-Decorator-(has-error))
7980
* Functionalities
8081
* [Alternate Text on Validators](https://github.com/ghiscoding/angular-validation/wiki/Alternate-Text-on-Validators)
8182
* [DisplayErrorTo](https://github.com/ghiscoding/angular-validation/wiki/Bootstrap-Input-Groups-Wrapping)

src/validation-directive.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@
183183
isValid = commonObj.validate(value, true);
184184
scope.$evalAsync(ctrl.$setValidity('validation', isValid ));
185185
deferred.resolve({ isFieldValid: isValid, formElmObj: formElmObj, value: value });
186+
$timeout.cancel(_timer);
186187
}else {
187188
// Start validation only after the user has stopped typing in a field
188189
// everytime a new character is typed, it will cancel/restart the timer & we'll erase any error mmsg
@@ -258,7 +259,7 @@
258259

259260
if (!formElmObj.isValidationCancelled) {
260261
// attempt to validate & run validation callback if user requested it
261-
var validationPromise = attemptToValidate(value, 10);
262+
var validationPromise = attemptToValidate(value, 0);
262263
if(!!_validationCallback) {
263264
commonObj.runValidationCallbackOnPromise(validationPromise, _validationCallback);
264265
}

src/validation-service.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ angular
104104
self.commonObj.initialize(scope, attrs.elm, attrs, attrs.ctrl);
105105

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

0 commit comments

Comments
 (0)