[Git][noosfero/noosfero][master] 2 commits: Fixes the loading bug when sending a scrap

Leandro Nunes gitlab at mg.gitlab.com
Thu Feb 23 14:59:20 BRT 2017


Leandro Nunes pushed to branch master at Noosfero / noosfero


Commits:
1dd3246f by Gabriel Silva at 2017-02-17T01:11:31+00:00
Fixes the loading bug when sending a scrap

Signed-off-by: Gabriel Silva <gabriel93.silva at gmail.com>

- - - - -
87b3f896 by Leandro Nunes at 2017-02-23T17:59:09+00:00
Merge branch 'scrap_progress' into 'master'

Fixes the loading bug when sending a scrap

Closes #231

See merge request !1120
- - - - -


3 changed files:

- app/views/profile/_profile_wall.html.erb
- app/views/profile/activities.html.erb
- public/stylesheets/profile-activity.scss


Changes:

=====================================
app/views/profile/_profile_wall.html.erb
=====================================
--- a/app/views/profile/_profile_wall.html.erb
+++ b/app/views/profile/_profile_wall.html.erb
@@ -2,7 +2,12 @@
 <% if allow_scrap? %>
   <div id='leave_scrap'>
   <%= flash[:error] %>
-  <%= form_remote_tag :url => {:controller => 'profile', :action => 'leave_scrap', :tab_action => 'wall' }, :update => 'profile_activities', :success => "jQuery('#leave_scrap_content').val(''); jQuery('#filter-followed').tokenInput('clear')", :complete => "jQuery('#leave_scrap_form').removeClass('loading').find('*').attr('disabled', false)", :loading => "jQuery('#leave_scrap_form').addClass('loading').find('*').attr('disabled', true)", :html => {:id => 'leave_scrap_form' } do %>
+  <%= form_remote_tag :url => {:controller => 'profile', :action => 'leave_scrap', :tab_action => 'wall' },
+                      :update => 'profile_activities',
+                      :success => "jQuery('#leave_scrap_content').val(''); if (jQuery('#filter-followed').length) jQuery('#filter-followed').tokenInput('clear')",
+                      :complete => "jQuery('#leave_scrap_form').removeClass('loading').find('*').attr('disabled', false)",
+                      :loading => "jQuery('#leave_scrap_form').addClass('loading').find('*').attr('disabled', true)",
+                      :html => {:id => 'leave_scrap_form' } do %>
     <%= limited_text_area :scrap, :content, 420, 'leave_scrap_content', :rows => 2, :class => 'autogrow' %>
     <% if profile == user %>
       <%= token_input_field_tag(:filter_followed, 'filter-followed', {:action => 'search_followed'}, {:theme => 'facebook', :placeholder => _('Filter followed, friends or group of friends to send them a private scrap...')}) %>


=====================================
app/views/profile/activities.html.erb
=====================================
--- a/app/views/profile/activities.html.erb
+++ b/app/views/profile/activities.html.erb
@@ -5,7 +5,12 @@
   <% if allow_scrap? %>
     <div id='leave_scrap'>
     <%= flash[:error] %>
-    <%= form_remote_tag :url => {:controller => 'profile', :action => 'leave_scrap', :tab_action => 'wall' }, :update => 'profile_activities', :success => "jQuery('#leave_scrap_content').val(''); jQuery('#filter-followed').tokenInput('clear')", :complete => "jQuery('#leave_scrap_form').removeClass('loading').find('*').attr('disabled', false)", :loading => "jQuery('#leave_scrap_form').addClass('loading').find('*').attr('disabled', true)", :html => {:id => 'leave_scrap_form' } do %>
+    <%= form_remote_tag :url => {:controller => 'profile', :action => 'leave_scrap', :tab_action => 'wall' },
+                        :update => 'profile_activities',
+                        :success => "jQuery('#leave_scrap_content').val(''); if (jQuery('#filter-followed').length) jQuery('#filter-followed').tokenInput('clear')",
+                        :complete => "jQuery('#leave_scrap_form').removeClass('loading').find('*').attr('disabled', false)",
+                        :loading => "jQuery('#leave_scrap_form').addClass('loading').find('*').attr('disabled', true)",
+                        :html => {:id => 'leave_scrap_form' } do %>
       <%= limited_text_area :scrap, :content, 420, 'leave_scrap_content', :rows => 2, :class => 'autogrow' %>
       <% if profile == user %>
         <%= token_input_field_tag(:filter_followed, 'filter-followed', {:action => 'search_followed'}, {:theme => 'facebook', :placeholder => _('Filter followed, friends or group of friends to send them a private scrap...')}) %>


=====================================
public/stylesheets/profile-activity.scss
=====================================
--- a/public/stylesheets/profile-activity.scss
+++ b/public/stylesheets/profile-activity.scss
@@ -395,7 +395,8 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img {
   overflow: hidden;
 }
 #leave_scrap .loading textarea {
-  background: url('/images/loading-small.gif') 50% 50% no-repeat;
+  background: #ffffff url('/images/loading-small.gif') 50% 50% no-repeat;
+  cursor: progress;
 }
 #leave_scrap .submit {
   margin-top: 5px;



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/1c00bec6021c1ab443a50872b5b8ccfaf21675f0...87b3f8961895966b0f00d34ae2fefdb976041cb4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170223/3cff21c7/attachment-0001.html>


More information about the Noosfero-dev mailing list