Thumbnail preview in Capture

Michelle michelle.dsouza at utoronto.ca
Wed Dec 2 16:31:54 UTC 2009


Hi Boyan,

I've replied inline below.


On 2009-12-01, at 5:43 AM, Boyan Sheytanov wrote:

> 
> 1. Is there a way to prevent the default action of an event without
> having the event itself? I am listening for the "onSelect" event of
> the Reorderer, which has a single argument - the item selected. I do
> not want to follow the link but couldn't find a way to prevent the
> default action since I do not have the event object (I had changed the
> href to "#" in order to stay on the same page).

Returning 'false' from your event listener should stop the default action. Try that and let me know if it works - if not I'll need to dig into the code a little.


> 2. How do you approach error handling? I receive the item that is
> selected in the Reorderer and look for an image tag. What if due to
> some reason there is no such tag (or there are two)? I added a check
> for that, invoking fluid.fail, but since I didn't see many similar
> calls in other components so I am wondering if I have done the right
> thing.

I think we should bring in a designer to decide how to deal with errors. 'fluid.fail' is a hard failure - I'm not certain you want to do that. You likely want to give a helpful message and recover the best you can. Perhaps a conversation with Jonathan is in order. 

> 3. I am using primarily jQuery to extract and substitute the source
> from the image tag. Should I try to use the model of the component
> (the list of images instead)? This would require to add some indexing
> (probably a hidden input field) and synchronization of the model after
> reordering.

Can you let me know a little more about about this? Why are you changing the source? Is it when the user selects a thumbnail?

I'll be online early tomorrow morning so we could talk about these things in the channel or on Skype if that's easier. 

Michelle




------------------------------------------------------
Michelle D'Souza
Software Developer, Fluid Project
Adaptive Technology Resource Centre
University of Toronto






More information about the fluid-work mailing list