[noosfero/noosfero][next] 2 commits: report-abuse: replace modal windwow by colorbox

Rodrigo Souto gitlab at gitlab.com
Tue Apr 21 17:25:21 BRT 2015


Rodrigo Souto pushed to branch next at Noosfero / noosfero


Commits:
ed63bab0 by Rodrigo Souto at 2015-04-21T17:25:01Z
report-abuse: replace modal windwow by colorbox

- - - - -
07ed3e2f by Rodrigo Souto at 2015-04-21T17:25:06Z
report-abuse: fix html parameter by converting it to json

- - - - -


2 changed files:

- app/views/profile/report_abuse.html.erb
- public/javascripts/report-abuse.js


Changes:

=====================================
app/views/profile/report_abuse.html.erb
=====================================
--- a/app/views/profile/report_abuse.html.erb
+++ b/app/views/profile/report_abuse.html.erb
@@ -9,7 +9,7 @@
   <% end %>
 
   <%= submit_button(:send, _('Report profile'), :style => 'float: left; cursor: pointer;', :id => 'report-abuse-submit-button', :onclick => "jQuery('#form-submit-loading').show()") %>
-  <%= button(:cancel, _('Cancel'), {}, :style => 'float: left; padding-top: 0px; padding-bottom: 0px;', :onclick => 'noosfero.modal.close(); return false;')%>
+  <%= button(:cancel, _('Cancel'), {}, :style => 'float: left; padding-top: 0px; padding-bottom: 0px;', :onclick => 'jQuery.colorbox.close(); return false;')%>
   <div id="form-submit-loading" class="small-loading" style="width: 16px; height: 16px; margin-top: 3px; float: left; display: none;"></div>
 <% end %>
 
@@ -24,13 +24,13 @@
     $('#report-abuse-submit-button').css('cursor', 'progress');
     $.ajax({
       type: 'POST',
-      url: <%= url_for({:controller => 'profile', :action => 'register_report', :profile => profile.identifier}) %>,
+      url: <%= url_for({:controller => 'profile', :action => 'register_report', :profile => profile.identifier}).to_json %>,
       data: $(form).serialize(),
       dataType: 'json',
       success: function(data, status, ajax){
         if ( !data.ok ) display_notice(data.error.message);
         else {
-          noosfero.modal.close();
+          $.colorbox.close();
           display_notice(data.message);
           window.location.reload();
         }


=====================================
public/javascripts/report-abuse.js
=====================================
--- a/public/javascripts/report-abuse.js
+++ b/public/javascripts/report-abuse.js
@@ -1,11 +1,8 @@
 jQuery(function($) {
   $('.report-abuse-action').live('click', function() {
-    if($(this).attr('href')){
-      noosfero.modal.inline($(this).attr('href'), {
-        innerHeight: '300px',
-        innerWidth: '445px'
-      });
-    }
+    if($(this).attr('href'))
+      $.colorbox({href: $(this).attr('href')});
+
     return false;
   });
 



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/1781dc2f2167345d2f693424f9ebdc87f494d38a...07ed3e2f211bf9641d85005c340d32af5428eb40
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150421/44f4e9ad/attachment.html>


More information about the Noosfero-dev mailing list