Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #976 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

[RESEARCH] Changeset 1014 -- :effect not callable

Reported by: courtenay Assigned to: David
Priority: normal Milestone:
Component: ActionPack Version: 0.11.0
Severity: normal Keywords:
Cc:

Description

With Ticket 1014, effects are only callable from callbacks such that :complete=>"new Effect.Highlight(element)"

However, when using code like this with an addition form

<%= form_remote_tag :url=>{:action=>'create'}, 
  :update=>'myelement', 
  :position=>'before', 
  :complete=>'new Effect.Highlight(\'myelement\');' %>

the problem arises that (a) element "myelement" is not the actual element that we're updating (we're adding to the DOM *before* this element) and (b) its not actually possible to know what we just added because there's no ID for the new DOM element, and no way to retrieve the id, if one was even set.

This is why we need 'effect' to be a callback from the actual Insertion functions and applied to the new DOM element.

Change History

03/28/05 17:37:19 changed by mortonda@dgrmm.net

But in so doing, don't make it only callable from the Insertion functions... it may have uses outside of those functions too.

03/28/05 17:55:03 changed by anonymous

Update: you can sorta hack around this but it gets ugly quickly. For example:

<%= form_remote_tag 
  :update=>'myelement', 
  :position=>'before',
  :complete=>'new Effect.Highlight(
    document.getElementById(\'myelement\').previousSibling);' %>

and so on, depending on how you are inserting

07/07/05 20:23:30 changed by court3nay

  • status changed from new to closed.
  • resolution set to fixed.

this is fixed with 0.13, :visual_effect