Commit bd921519daa01ea85e3b0e54f4319b3973a5c088

Authored by Macartur Sousa
1 parent cab1ca15
Exists in master and in 1 other branch mezuro_spb

Fixed cancel button to avoid use javascrit action

Signed-off-by: Macartur Sousa <macartur.sc@gmail.com>
src/noosfero-spb/gov_user/public/views/create-institution.js
... ... @@ -164,12 +164,6 @@ modulejs.define(&#39;CreateInstitution&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SelectElement&#39;]
164 164 });
165 165 }
166 166  
167   - function cancel_institution(evt){
168   - evt.preventDefault();
169   - $('#institution_modal').modal('toggle');
170   - }
171   -
172   -
173 167 function institution_already_exists(){
174 168 if( this.value.length >= 3 ) {
175 169 $.get(AJAX_URL.institution_already_exists, {name:this.value}, function(response){
... ... @@ -373,7 +367,6 @@ modulejs.define(&#39;CreateInstitution&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SelectElement&#39;]
373 367 });
374 368  
375 369 $('#save_institution_button').click(save_institution);
376   - $('#cancel_institution_button').click(cancel_institution);
377 370  
378 371 $("#community_name").keyup(institution_already_exists);
379 372  
... ...
src/noosfero-spb/gov_user/views/gov_user_plugin/_institution.html.erb
... ... @@ -181,7 +181,7 @@
181 181 <%= button(:cancel, _("Cancel"), {:controller => "admin_panel", :action => 'index'}) %>
182 182 <% else %>
183 183 <%= link_to(_('Save'), '#', :id=>'save_institution_button', :class=>'button with-text icon-add') %>
184   - <%= link_to(_('Cancel'), '#', :id=>"cancel_institution_button", :class=>'button with-text icon-cancel') %>
  184 + <%= link_to(_('Cancel'), '#', :id=>"cancel_institution_button", :class=>'button with-text icon-cancel', "data-dismiss".to_sym => "modal") %>
185 185 <%= hidden_field_tag :institution_error_message, _("Could not send the form data to the server") %>
186 186 <% end %>
187 187 </div>
... ...