Commit ed63bab09a77c398c9228030a8ace0f11e9a6268

Authored by Rodrigo Souto
1 parent 1781dc2f

report-abuse: replace modal windwow by colorbox

app/views/profile/report_abuse.html.erb
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 <% end %> 9 <% end %>
10 10
11 <%= submit_button(:send, _('Report profile'), :style => 'float: left; cursor: pointer;', :id => 'report-abuse-submit-button', :onclick => "jQuery('#form-submit-loading').show()") %> 11 <%= submit_button(:send, _('Report profile'), :style => 'float: left; cursor: pointer;', :id => 'report-abuse-submit-button', :onclick => "jQuery('#form-submit-loading').show()") %>
12 - <%= button(:cancel, _('Cancel'), {}, :style => 'float: left; padding-top: 0px; padding-bottom: 0px;', :onclick => 'noosfero.modal.close(); return false;')%> 12 + <%= button(:cancel, _('Cancel'), {}, :style => 'float: left; padding-top: 0px; padding-bottom: 0px;', :onclick => 'jQuery.colorbox.close(); return false;')%>
13 <div id="form-submit-loading" class="small-loading" style="width: 16px; height: 16px; margin-top: 3px; float: left; display: none;"></div> 13 <div id="form-submit-loading" class="small-loading" style="width: 16px; height: 16px; margin-top: 3px; float: left; display: none;"></div>
14 <% end %> 14 <% end %>
15 15
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 success: function(data, status, ajax){ 30 success: function(data, status, ajax){
31 if ( !data.ok ) display_notice(data.error.message); 31 if ( !data.ok ) display_notice(data.error.message);
32 else { 32 else {
33 - noosfero.modal.close(); 33 + $.colorbox.close();
34 display_notice(data.message); 34 display_notice(data.message);
35 window.location.reload(); 35 window.location.reload();
36 } 36 }
public/javascripts/report-abuse.js
1 jQuery(function($) { 1 jQuery(function($) {
2 $('.report-abuse-action').live('click', function() { 2 $('.report-abuse-action').live('click', function() {
3 - if($(this).attr('href')){  
4 - noosfero.modal.inline($(this).attr('href'), {  
5 - innerHeight: '300px',  
6 - innerWidth: '445px'  
7 - });  
8 - } 3 + if($(this).attr('href'))
  4 + $.colorbox({href: $(this).attr('href')});
  5 +
9 return false; 6 return false;
10 }); 7 });
11 8