Hi, inplaceeditor saving image loads only first time once, or after page refresh: http://www.kende.com/js/ Is this a bug ? .inplaceeditor-saving { background: url(wait16.gif) bottom right no-repeat; } Thanks, Andras Kende http://www.kende.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2007-Apr-15 10:15 UTC
Re: inplaceeditor saving image loads only first time once
Hey Andras! Andras Kende a écrit :> inplaceeditor saving image loads only first time once, or after page > refresh: > > http://www.kende.com/js/ > > Is this a bug ? > > .inplaceeditor-saving { > background: url(wait16.gif) bottom right no-repeat; > }I hit the exact same bug yesterday, and I''m investigating it today. The problem is that for some unknown reason, at some point after the first processing, the inline style''s backgroundImage property gets set to none, which overrides the CSS. I''m about to significantly refactor IPE for SAU''s next version, with a deprecation adapter to let existing code work and give people time to migrate over. In the meantime, when I find the reason for this specific problem, I''ll post the fix here :-) -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2007-Apr-15 13:43 UTC
Re: inplaceeditor saving image loads only first time once
Hey again, Andras, Andras Kende a écrit :> inplaceeditor saving image loads only first time once, or after page > refresh: > > http://www.kende.com/js/ > > Is this a bug ? > > .inplaceeditor-saving { > background: url(wait16.gif) bottom right no-repeat; > }Figured it out. It will go away with the new, refactored version, but here''s the deal for the current one. By default, the onComplete option triggers a Effect.Highlight on the element, from the highlightcolor option to the saved background color. As you may know, Effect.Highlight will attempt to clear the background image during the fade, restoring it at the end. The backup operation relies on getStyle, which requires inline specification of the property (it won''t see any CSS-defined prop). So it doesn''t see your background image, and restores to ''none''. The best way around this, since inline styles are mostly difficult due to the transient use of the background image, is to override the onComplete default, like so: new Ajax.InPlaceEditor(''yourId'', ''/your/url'', { // Whatever options you had, onComplete: function() { new Effect.Highlight(element, { startcolor: Ajax.InPlaceEditor.defaultHighlightColor, keepBackgroundImage: true // The key change! }); } }); The CSS class will be disabled anyway when onComplete triggers, so you won''t see your spinner during the fadeover after save. But this will prevent the effect from overriding the style''s background-image property, which in turn won''t trumple your CSS-defined image. If you customized the highlightcolor option, don''t forget to use the same value for the startcolor option here. ''HTH -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---