From 81620d4f94575a36f49e95975ba2fd064359ae12 Mon Sep 17 00:00:00 2001 From: denise Date: Wed, 19 Sep 2012 12:41:54 -0400 Subject: [PATCH] CC-4481: Library -> Advanced Search -> Validation icon does not show up sometimes -fixed --- airtime_mvc/public/js/airtime/library/library.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index e5cae78e0..795bcb010 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -38,6 +38,7 @@ var AIRTIME = (function(AIRTIME) { "track_num" : "n", "year" : "n", "owner_id" : "s", + "info_url" : "s", "replay_gain" : "n" }; @@ -1041,6 +1042,7 @@ function addQtipToSCIcons(){ */ function validateAdvancedSearch(divs) { var valid = true, + allValid = true, fieldName, fields, searchTerm = Array(), @@ -1053,7 +1055,6 @@ function validateAdvancedSearch(divs) { searchTerm[0] = ""; searchTerm[1] = ""; - $.each(divs, function(i, div){ fieldName = $(div).children(':nth-child(2)').attr('id'); fields = $(div).children().find('input'); @@ -1085,6 +1086,7 @@ function validateAdvancedSearch(divs) { //string fields do not need validation if (searchTermType !== "s") { valid = regExpr.test(searchTerm[i]); + if (!valid) allValid = false; } addRemoveValidationIcons(valid, $(field)); @@ -1107,13 +1109,9 @@ function validateAdvancedSearch(divs) { return false; } }); - - if (!valid) { - return false; - } }); - - return valid; + + return allValid; } function addRemoveValidationIcons(valid, field) {