Why no onPhotoShow in filmstrip view?

jfriendjfriend Registered Users Posts: 8,097 Major grins
I'm trying to do some JavaScript customization that needs to put something into the page that is specific to the main image being displayed. I have it worked for nearly all views, but not in the filmstrip view.

For some reason, the filmstrip view loads a new image into the page without reloading a new page (e.g. via Ajax and DHTML), but it doesn't call onPhotoShow subscribers like the Smugmug view does.

onPhotoShow works great in the Smugmug view for letting a Javascript know when a new image has been loaded dynamically. Why isn't it being used in the filmstrip view which is doing the same thing? Is there some other way to know when a new photo has been loaded in the filmstrip view?
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question

Comments

  • jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited September 6, 2008
    Anyone?
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited September 6, 2008
    John, this is Lee or JT's domain. I was make a guess that filmstrip mode doesn't use the ajax stuff that SmugMug style does.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited September 6, 2008
    devbobo wrote:
    John, this is Lee or JT's domain. I was make a guess that filmstrip mode doesn't use the ajax stuff that SmugMug style does.

    Cheers,

    David

    It would be great of JT or Lee could drop by sometime and let me know how this works or is supposed to work.

    The filmstrip view does rewrite the main image in the page without changing the URL or reloading a page (kind of like the Smugmug view). No other views do that.

    Therefore, it would be real handy to have a JS hook whenever the main image changes. onPhotoShow is such a hook in the Smugmug view and it would be trivial to call onPhotoShow.fire to trigger the subscriber notification. Or, I could live with some other mechanism, though that would be a lot less consistent for JS developers.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited September 8, 2008
    In a related question, I'm wondering if there's a YUI event that I could register for anytime the photoInfo array in the Smugmug view is modified. I'm specifically interested in two times that's it's modified:
    1. When it's first loaded when a new page in the Smugmug view comes up. I'd like to see the array after it's loaded, but before the page has been drawn so other events are too late
    2. When it gets changed because the window has been resized enough to cause a new image size or new thumb layout to be chosen
    Right now, I've subscribed to onPhotoShow, but that is called way more often than I need (like every click on a thumb) and it's a lot of wasted Javascript execution for me to try to figure out if parts of the photoInfo array have changed every time onPhotoShow is called. The first time it's called is also a little late for what I'm trying to do when the page is first loaded. Thus, some sort of YUI event that got called anytime the photoInfo array was reloaded (via an ajax RPC call) would be perfect for my application.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
Sign In or Register to comment.