Hello,

i found a bug with your code. When there aren't any images available, the jquery code breaks with the following code error:

imageData is undefined
[Break On This Error] var index = imageData.index; 

I tried to use an if statement before line 505 on the .js file, but another line broke. Personally i prefer not to load additional js when we don't need them.
Is it possible to load the js, when we really need them?

Thanks,
apanag.

Comments

acouch’s picture

Status: Active » Closed (works as designed)

It would be relatively easy to do this if there is no result in the view, but messy to check for each of the image fields to see if they are not every populated for all of the results.

I'm not going to institute this but if enough people think it is useful I might.

gmclelland’s picture

Could we wrap the drupal_add_js calls in the views-galleriffic-view.tpl.php in an if statement?

if there are views results
drupal_add_js (add all views_galleriffic javascript)
end if

Not knowing views well enough, I'm not sure it is possible. I just thought I would throw that out there.

-Glenn

acouch’s picture

We could do that, but that doesn't guarantee we won't have any empty set because there could be a row in views that doesn't have any images in it. So checking the result would not work unless we checked which fields had images and walking through each row and seeing if there are images.

I'm sure if this would solve the OPs issue or not so leaving this out for now. This also seems like the View itself should not load if there are no results. Will have to look into that more. I might add what you suggested next time I get cracking on this, will be more motivated if more folks think this is necessary.