From b5b8f63e1ebc75d09c6faf8dbad6497880deed47 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Tue, 30 Mar 2010 15:39:51 -0700 Subject: more tests passing --- src/Angular.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/Angular.js') diff --git a/src/Angular.js b/src/Angular.js index 4443890a..27f463ac 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -5,6 +5,8 @@ if (!window['console']) window['console']={'log':noop, 'error':noop}; var consoleNode, NOOP = 'noop', + NG_ERROR = 'ng-error', + NG_VALIDATION_ERROR = 'ng-validation-error', jQuery = window['jQuery'] || window['$'], // weirdness to make IE happy _ = window['_'], jqLite = jQuery || jqLiteWrap, @@ -226,12 +228,12 @@ function escapeHtml(html) { replace(/>/g, '>'); } -function elementDecorateError(element, error) { +function elementError(element, type, error) { if (error) { - element.addClass(NG_VALIDATION_ERROR); + element.addClass(type); element.attr(NG_ERROR, error); } else { - element.removeClass(NG_VALIDATION_ERROR); + element.removeClass(type); element.removeAttr(NG_ERROR); } } -- cgit v1.2.3