With the new changes to the Spotlight JavaScript (#2528924: Spotlight accessibility regressions), I think it has become bit more difficult to count actual user clicks on slide numbers for analytical purposes.

The new code leverages the JavaScript .click() event to change the slide both when a user clicks a slide number as well as when the Spotlight automatically advances to the next slide. This makes any data collection on clicks of the slide numbers useless.

The updated code is elegant in its simplicity, I'm not suggesting that we do any radical changes. Instead, I'm wondering if there is a way that we can separate actual person-clicks from automated Spotlight slide-advancement "clicks".

-mike

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dsnopek’s picture

We could put a jQuery tag on the event we attach, and then call that event directly?

So, something like: .bind('click.panopoly-widgets-spotlight') and then .trigger('click.panopoly-widgets-spotlight'). Then if you attached your own click handler, it wouldn't get called by the rotate() function.

Would that work for your use case?

ultimike’s picture

Status: Active » Needs review
FileSize
3.51 KB

I think it will - I just did a quick test and all looks good. We'll do some additional testing and report back if we find any issues. Patch attached.

thanks,
-mike

  • dsnopek committed ee1fb5f on 7.x-1.x
    Update Panopoly Widgets for Issue #2534936 by ultimike: Counting...
dsnopek’s picture

Status: Needs review » Fixed

Thanks! Patch looks good, and worked in my testing. I'm just going to commit this - I think using a jQuery tag on the event is the right thing to do anyway. Please feel free to re-open, though, if you find any issues on your end!

ultimike’s picture

Status: Fixed » Needs review
FileSize
596 bytes

@dnospek,

Re-opening this issue, as the previous patch was missing one crucial thing - when the slide is automatically rotated, the patch wasn't using the new jQuery tag. The attached patch fixes this.

thanks,
-mike

  • dsnopek committed 28d20a9 on 7.x-1.x
    Update Panopoly Widgets for Issue #2534936 by ultimike: Counting...
dsnopek’s picture

Status: Needs review » Fixed

Oops! Tested the patch and the spotlight continues to work for me. Committed! :-)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.