mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-04 08:58:16 +08:00
style(input): fix style violations in the input.js file
This commit is contained in:
@@ -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) {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user