Commit b2b92046ff675e77d6a7613deedbf8fbd4977873
Committed by
Fabio Teixeira
1 parent
0a70acfc
Exists in
master
and in
3 other branches
Remove unused auto complete function
Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
Showing
1 changed file
with
5 additions
and
23 deletions
Show diff stats
public/views/create-institution.js
| ... | ... | @@ -132,7 +132,12 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] |
| 132 | 132 | return verify_error.test(field.getAttribute("name")); |
| 133 | 133 | }); |
| 134 | 134 | |
| 135 | + var selects_with_errors = $("#institution_dialog .formfield select").filter(function(index, field) { | |
| 136 | + return verify_error.test(field.getAttribute("name")); | |
| 137 | + }); | |
| 138 | + | |
| 135 | 139 | fields_with_errors.addClass("highlight-error"); |
| 140 | + selects_with_errors.addClass("highlight-error"); | |
| 136 | 141 | } |
| 137 | 142 | |
| 138 | 143 | |
| ... | ... | @@ -275,7 +280,6 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] |
| 275 | 280 | cnpj.hide(); |
| 276 | 281 | city.hide(); |
| 277 | 282 | state.hide(); |
| 278 | - autocomplete_city(); | |
| 279 | 283 | } else { |
| 280 | 284 | cnpj.show(); |
| 281 | 285 | city.show(); |
| ... | ... | @@ -283,32 +287,10 @@ modulejs.define('CreateInstitution', ['jquery', 'NoosferoRoot', 'SelectElement'] |
| 283 | 287 | } |
| 284 | 288 | } |
| 285 | 289 | |
| 286 | - function autocomplete_city(){ | |
| 287 | - $('#city_field').autocomplete({ | |
| 288 | - source : function(request, response){ | |
| 289 | - $.ajax({ | |
| 290 | - type: "GET", | |
| 291 | - url: '/account/search_cities', | |
| 292 | - data: {city_name: request.term, state_name: $("#community_state").val()}, | |
| 293 | - success: function(result){ | |
| 294 | - response(result); | |
| 295 | - }, | |
| 296 | - error: function(ajax, stat, errorThrown) { | |
| 297 | - console.log('Link not found : ' + errorThrown); | |
| 298 | - } | |
| 299 | - }); | |
| 300 | - }, | |
| 301 | - | |
| 302 | - minLength: 3 | |
| 303 | - }); | |
| 304 | - } | |
| 305 | - | |
| 306 | - | |
| 307 | 290 | function institution_type_actions(type) { |
| 308 | 291 | var country = $("#community_country").val(); |
| 309 | 292 | if( type === "PublicInstitution" && country == "BR") { |
| 310 | 293 | show_public_institutions_fields(); |
| 311 | - autocomplete_city(); | |
| 312 | 294 | } else { |
| 313 | 295 | show_private_institutions_fields(); |
| 314 | 296 | } | ... | ... |