mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
style(input): fix style violations in the input.js file
This commit is contained in:
parent
78f394fd17
commit
3217a249e1
1 changed files with 10 additions and 8 deletions
|
|
@ -6,6 +6,7 @@ var EMAIL_REGEXP = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/;
|
|||
var NUMBER_REGEXP = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/;
|
||||
var INTEGER_REGEXP = /^\s*(\-|\+)?\d+\s*$/;
|
||||
|
||||
|
||||
/**
|
||||
* @ngdoc inputType
|
||||
* @name angular.inputType.text
|
||||
|
|
@ -143,6 +144,7 @@ angularInputType('email', function() {
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* @ngdoc inputType
|
||||
* @name angular.inputType.url
|
||||
|
|
@ -216,6 +218,7 @@ angularInputType('url', function() {
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* @ngdoc inputType
|
||||
* @name angular.inputType.list
|
||||
|
|
@ -287,6 +290,7 @@ angularInputType('list', function() {
|
|||
};
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* @ngdoc inputType
|
||||
* @name angular.inputType.number
|
||||
|
|
@ -356,6 +360,7 @@ angularInputType('list', function() {
|
|||
*/
|
||||
angularInputType('number', numericRegexpInputType(NUMBER_REGEXP, 'NUMBER'));
|
||||
|
||||
|
||||
/**
|
||||
* @ngdoc inputType
|
||||
* @name angular.inputType.integer
|
||||
|
|
@ -425,6 +430,7 @@ angularInputType('number', numericRegexpInputType(NUMBER_REGEXP, 'NUMBER'));
|
|||
*/
|
||||
angularInputType('integer', numericRegexpInputType(INTEGER_REGEXP, 'INTEGER'));
|
||||
|
||||
|
||||
/**
|
||||
* @ngdoc inputType
|
||||
* @name angular.inputType.checkbox
|
||||
|
|
@ -496,9 +502,9 @@ angularInputType('checkbox', function(inputElement) {
|
|||
widget.$parseView = function() {
|
||||
widget.$modelValue = widget.$viewValue ? trueValue : falseValue;
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* @ngdoc inputType
|
||||
* @name angular.inputType.radio
|
||||
|
|
@ -765,15 +771,13 @@ angularWidget('input', function(inputElement){
|
|||
controller: TypeController,
|
||||
controllerArgs: [inputElement]});
|
||||
|
||||
widget.$pattern =
|
||||
watchElementProperty(this, widget, 'required', inputElement);
|
||||
watchElementProperty(this, widget, 'readonly', inputElement);
|
||||
watchElementProperty(this, widget, 'disabled', inputElement);
|
||||
|
||||
|
||||
widget.$pristine = !(widget.$dirty = false);
|
||||
|
||||
widget.$on('$validate', function(event) {
|
||||
widget.$on('$validate', function() {
|
||||
var $viewValue = trim(widget.$viewValue),
|
||||
inValid = widget.$required && !$viewValue,
|
||||
tooLong = maxlength && $viewValue && $viewValue.length > maxlength,
|
||||
|
|
@ -796,9 +800,8 @@ angularWidget('input', function(inputElement){
|
|||
|
||||
forEach(['valid', 'invalid', 'pristine', 'dirty'], function(name) {
|
||||
widget.$watch('$' + name, function(scope, value) {
|
||||
inputElement[value ? 'addClass' : 'removeClass']('ng-' + name);
|
||||
}
|
||||
);
|
||||
inputElement[value ? 'addClass' : 'removeClass']('ng-' + name);
|
||||
});
|
||||
});
|
||||
|
||||
inputElement.bind('$destroy', function() {
|
||||
|
|
@ -849,4 +852,3 @@ function watchElementProperty(modelScope, widget, name, element) {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue