Foundation-sites: [Sticky] Event names in documentation are incorrect

Created on 19 Jan 2016  路  10Comments  路  Source: foundation/foundation-sites

Documentation at http://foundation.zurb.com/sites/docs/sticky.html lists the event names as stuckto.zf.sticky and unstuckfrom.zf.sticky. Per the source, those should be sticky.zf.stuckto and sticky.zf.unstuckfrom.

Would submit a PR myself, but the "Edit this Page" link on the docs takes me to a lorem-ipsum-filled page, not the actual source of the Sticky docs.

Sticky javascript 馃悰bug 馃摉 documentation

Most helpful comment

@jeremylind lol yup. Just came accross this issue myself. In fact, even the 'correct' sticky.zf.stuckto and sticky.zf.unstuckfrom don't work.

 /*
sticky.zf.unstuckfrom:top, 
sticky.zf.stuckto, 
sticky.zf.unstuckfrom, don't work either.
*/

$('.element').on('sticky.zf.stuckto:top', function() {
  console.log('fixmeplease');
});

Quite annoying considering this issue prevents us from _easily_ adding custom events to the sticky.js plugin _and_ is practically 9 months old to boot (@JeremyEnglert). Come on guys, this doesn't help your advanced users.

All 10 comments

That takes you to the markdown page used to generate the documentation. The issue you filed is a known issue, and an ongoing problem we're having with JSDoc not compiling comments on events correctly.

@zurbchris Either way the event names in the code itself are written backwards: namespace, then event name. See: https://github.com/zurb/foundation-sites/blob/develop/js/foundation.sticky.js#L279

If that was intentional, then we'll need to rework the JavaScript reference template to account for that.

I'll update the docs with the correct event names.

Looks like this still isn't fixed. See: http://foundation.zurb.com/sites/docs/sticky.html#js-events.

@jeremylind lol yup. Just came accross this issue myself. In fact, even the 'correct' sticky.zf.stuckto and sticky.zf.unstuckfrom don't work.

 /*
sticky.zf.unstuckfrom:top, 
sticky.zf.stuckto, 
sticky.zf.unstuckfrom, don't work either.
*/

$('.element').on('sticky.zf.stuckto:top', function() {
  console.log('fixmeplease');
});

Quite annoying considering this issue prevents us from _easily_ adding custom events to the sticky.js plugin _and_ is practically 9 months old to boot (@JeremyEnglert). Come on guys, this doesn't help your advanced users.

Yeah, we're identifying a lot of issues in the events, so definitely hear your pain. The docs are assuming a structure to events that sticky is violating, so unfortunately I don't have a quick fix to the docs... I believe the real fix is to fix the event name to match the structure of the rest of our events

The event name fix will need to wait until 6.3 because it is backwards incompatible.

@coreysyms is compiling a list of events and lifecycle hooks so we can standardize this across all of foundation, hopefully we'll be able to hit that in roughly the same timeframe.

In the meantime, the actual event names getting fired are as highlighted by @licyeus in the original comment, sticky.zf.unstuckfrom:top, sticky.zf.unstuckfrom:bottom, sticky.zf.stuckto:top, and sticky.zf.stuckto:bottom

Has this been fixed?

I see it working in your codepen example but can not get anything to fire here.

Has anyone else been able to get anything to fire? if so can you post you code?

@dtlevin Take a look at this pen: https://codepen.io/zurbchris/pen/rxMaoX

I experienced the same problem, but this is working for me. It seems that the :top / :bottom suffix is mandatory - which is not entirely clear by the documentation.

Wow! Two years to update the documentation. Really?!

@renatonascalves Sorry for the late reply, some old issues got "lost" as we were working on the lastest. We are currently making a pass on all the Foundation issues to prepare the v7.

Also, this should be resolved in https://github.com/zurb/foundation-docs/pull/24 ;)

Was this page helpful?
0 / 5 - 0 ratings