Commit 7b2206ed2a8767361832802d1081a5a5d4d9493b

Authored by Fabio Teixeira
1 parent 5c1eb238
Exists in master and in 79 other branches add_sisp_to_chef, add_super_archives_plugin, api_for_colab, automates_core_packing, backup_not_prod, changes_in_buttons_on_content_panel, colab_automated_login, colab_spb_plugin_recipe, colab_widgets_settings, design_validation, dev_env_minimal, disable_email_dev, fix_breadcrumbs_position, fix_categories_software_link, fix_edit_institution, fix_edit_software_with_another_license, fix_get_license_info, fix_gitlab_assets_permission, fix_list_style_inside_article, fix_list_style_on_folder_elements, fix_members_pagination, fix_merge_request_url, fix_models_translations, fix_no_license, fix_software_api, fix_software_block_migration, fix_software_communities_translations, fix_software_communities_unit_test, fix_style_create_institution_admin_panel, fix_superarchives_imports, fix_sym_links_noosfero, focus_search_field_theme, gov-user-refactoring, gov-user-refactoring-rails4, header_fix, institution_modal_on_rating, kalibro-conf-refactoring, kalibro-processor-package, lxc_settings, margin_fix, mezuro_cookbook, prezento, refactor_download_block, refactor_software_communities, refactor_software_for_sisp, register_page, release-process, release-process-v2, remove-unused-images, remove_broken_theme, remove_secondary_email_from_user, remove_sisp_buttons, removing_super_archives_email, review_message, scope2method, signals_user_noosfero, sisp_catalog_header, sisp_colab_config, sisp_dev, sisp_dev_master, sisp_simple_version, software_as_organization, software_catalog_style_fix, software_communities_html_refactor, software_infos_api, spb_minimal_env, spb_to_rails4, spec_refactor, stable-4.1, stable-4.2, stable-4.x, temp_soft_comm_refactoring, theme_header, theme_javascript_refactory, thread_dropdown, thread_page, update_search_by_categories, update_software_api, update_softwares_boxes

Fix institution city autocomplete bug

Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Showing 1 changed file with 9 additions and 12 deletions   Show diff stats
public/views/create-institution.js
... ... @@ -55,8 +55,8 @@ modulejs.define(&#39;CreateInstitution&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SelectElement&#39;]
55 55 name : $("#community_name").val(),
56 56 country : $("#community_country").val(),
57 57 state : $("#community_state").val(),
58   - city : $("#city_field").val()
59   - }
  58 + city : $("#community_city").val()
  59 + };
60 60 }
61 61  
62 62  
... ... @@ -69,7 +69,7 @@ modulejs.define(&#39;CreateInstitution&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SelectElement&#39;]
69 69 governmental_sphere: $("#institutions_governmental_sphere").selected().val(),
70 70 juridical_nature: $("#institutions_juridical_nature").selected().val(),
71 71 corporate_name: $("#institutions_corporate_name").val()
72   - }
  72 + };
73 73 }
74 74  
75 75  
... ... @@ -274,7 +274,7 @@ modulejs.define(&#39;CreateInstitution&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SelectElement&#39;]
274 274 var city = $("#community_city").parent().parent();
275 275 var state = $("#community_state").parent().parent();
276 276 var inst_type = $("input[name='institutions[type]']:checked").val();
277   - institution_type_actions(inst_type)
  277 + institution_type_actions(inst_type);
278 278  
279 279 if( country === "-1" ) $("#community_country").val("BR");
280 280  
... ... @@ -323,10 +323,9 @@ modulejs.define(&#39;CreateInstitution&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SelectElement&#39;]
323 323 }
324 324  
325 325 function autoCompleteCity() {
326   - var country_selected = $('#community_country').val()
  326 + var country_selected = $('#community_country').val();
327 327  
328   - if(country_selected == "BR")
329   - {
  328 + if(country_selected == "BR") {
330 329 $('#community_city').autocomplete({
331 330 source : function(request, response){
332 331 $.ajax({
... ... @@ -348,9 +347,7 @@ modulejs.define(&#39;CreateInstitution&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SelectElement&#39;]
348 347  
349 348 minLength: 3
350 349 });
351   - }
352   - else
353   - {
  350 + } else {
354 351 if ($('#community_city').data('autocomplete')) {
355 352 $('#community_city').autocomplete("destroy");
356 353 $('#community_city').removeData('autocomplete');
... ... @@ -385,7 +382,7 @@ modulejs.define(&#39;CreateInstitution&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SelectElement&#39;]
385 382 autoCompleteCity();
386 383 $('#community_country').change(function(){
387 384 autoCompleteCity();
388   - })
  385 + });
389 386 }
390 387  
391 388  
... ... @@ -399,5 +396,5 @@ modulejs.define(&#39;CreateInstitution&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SelectElement&#39;]
399 396 set_form_count_custom_data();
400 397 set_events();
401 398 }
402   - }
  399 + };
403 400 });
... ...