From b2b92046ff675e77d6a7613deedbf8fbd4977873 Mon Sep 17 00:00:00 2001 From: Gabriela Navarro Date: Wed, 6 May 2015 12:48:23 +0000 Subject: [PATCH] Remove unused auto complete function --- public/views/create-institution.js | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/public/views/create-institution.js b/public/views/create-institution.js index e315380..f759f26 100644 --- a/public/views/create-institution.js +++ b/public/views/create-institution.js @@ -132,7 +132,12 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] return verify_error.test(field.getAttribute("name")); }); + var selects_with_errors = $("#institution_dialog .formfield select").filter(function(index, field) { + return verify_error.test(field.getAttribute("name")); + }); + fields_with_errors.addClass("highlight-error"); + selects_with_errors.addClass("highlight-error"); } @@ -275,7 +280,6 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] cnpj.hide(); city.hide(); state.hide(); - autocomplete_city(); } else { cnpj.show(); city.show(); @@ -283,32 +287,10 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] } } - function autocomplete_city(){ - $('#city_field').autocomplete({ - source : function(request, response){ - $.ajax({ - type: "GET", - url: '/account/search_cities', - data: {city_name: request.term, state_name: $("#community_state").val()}, - success: function(result){ - response(result); - }, - error: function(ajax, stat, errorThrown) { - console.log('Link not found : ' + errorThrown); - } - }); - }, - - minLength: 3 - }); - } - - function institution_type_actions(type) { var country = $("#community_country").val(); if( type === "PublicInstitution" && country == "BR") { show_public_institutions_fields(); - autocomplete_city(); } else { show_private_institutions_fields(); } -- libgit2 0.21.2