I am using the jquery-ui-1.8.16.custom.min.js lib... to toggle my sidebar-views =====.. $(''.toggle-view li'').click(function () { var text = $(this).children(''p''); if (text.is('':hidden'')) { text.slideDown(''fast''); $(this).children(''h4'').addClass(''active''); } else { text.slideUp(''fast''); $(this).children(''h4'').removeClass(''active''); } }); ... ===== I have a strange behavior : without any pre-compilation ( rake assets:clean ) it runs well... toggle is good then I pre-compile locally my assets before deployment running again in development ... toggle doesn''t work anymore .. it slideDown and slideUp immediately if I clear again the assets : rake assets:clean , then correct toggle behavior is good again .. what could happen when I run : bundle exec rake assets:precompile:all to make this happen ? thanks for your feedback -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law
2012-Jan-09 12:11 UTC
Re: [Rails 3.1] weird jQuery behavior when pre-compiling assets
On 9 January 2012 12:02, Erwin <yves_dufour-ee4meeAH724@public.gmane.org> wrote:> I am using the jquery-ui-1.8.16.custom.min.js lib... to toggle my > sidebar-views > > =====> .. > $(''.toggle-view li'').click(function () { > var text = $(this).children(''p''); > if (text.is('':hidden'')) { > text.slideDown(''fast''); > $(this).children(''h4'').addClass(''active''); > } else { > text.slideUp(''fast''); > $(this).children(''h4'').removeClass(''active''); > } > }); > ... > =====> > I have a strange behavior : without any pre-compilation ( rake > assets:clean ) it runs well... toggle is good > then I pre-compile locally my assets before deployment > running again in development ... toggle doesn''t work anymore .. it > slideDown and slideUp immediately > > if I clear again the assets : rake assets:clean , then correct > toggle behavior is good again .. > > what could happen when I run : bundle exec rake > assets:precompile:all to make this happen ?I wonder whether you have an error in the script that behaves differently when compiled. First run with firebug in firefox with it not compiled and see if there are any errors. Then repeat with it compiled. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ankit Varshney
2012-Jan-11 07:32 UTC
Re: [Rails 3.1] weird jQuery behavior when pre-compiling assets
Use jquery-rails gem this will solve your issue and also maintain your update related to jquery Thanks & Regards Ankit Varshney On Mon, Jan 9, 2012 at 5:41 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 9 January 2012 12:02, Erwin <yves_dufour-ee4meeAH724@public.gmane.org> wrote: > > I am using the jquery-ui-1.8.16.custom.min.js lib... to toggle my > > sidebar-views > > > > =====> > .. > > $(''.toggle-view li'').click(function () { > > var text = $(this).children(''p''); > > if (text.is('':hidden'')) { > > text.slideDown(''fast''); > > $(this).children(''h4'').addClass(''active''); > > } else { > > text.slideUp(''fast''); > > $(this).children(''h4'').removeClass(''active''); > > } > > }); > > ... > > =====> > > > I have a strange behavior : without any pre-compilation ( rake > > assets:clean ) it runs well... toggle is good > > then I pre-compile locally my assets before deployment > > running again in development ... toggle doesn''t work anymore .. it > > slideDown and slideUp immediately > > > > if I clear again the assets : rake assets:clean , then correct > > toggle behavior is good again .. > > > > what could happen when I run : bundle exec rake > > assets:precompile:all to make this happen ? > > I wonder whether you have an error in the script that behaves > differently when compiled. First run with firebug in firefox with it > not compiled and see if there are any errors. Then repeat with it > compiled. > > Colin > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.