Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove leading '#' from captionLocation in foundation.orbit.js #1252

Merged
merged 1 commit into from
Dec 5, 2012
Merged

remove leading '#' from captionLocation in foundation.orbit.js #1252

merged 1 commit into from
Dec 5, 2012

Conversation

mattnworb
Copy link

If the caption for an orbit slider is set like

data-caption="#someDiv"

Then line 392 sets the id attribute of the element containing the caption to #someDiv.

This patch removes the leading # in the selector if it exists before applying it to the id attribute, so that any CSS rules designed to target a specific caption for a specific slider frame can work.

mrsweaters pushed a commit that referenced this pull request Dec 5, 2012
remove leading '#' from captionLocation in foundation.orbit.js
@mrsweaters mrsweaters merged commit 551de4a into foundation:master Dec 5, 2012
@mrsweaters
Copy link
Contributor

looks good.

@alvinsiu
Copy link

alvinsiu commented Jan 1, 2013

From my download of Foundation 3 today, captions no longer show up because this patch removes the leading '#' in the selector before the captions contents are parsed. In "jquery.foundation.orbit.js," this is in lines 391-394.

Easy fix would be to put line 394 before line 391 so that the caption span is parsed before the leading '#' has been removed:

390. // if location selector starts with '#', remove it so we don't see id="#selector"
391. if (captionLocation.charAt(0) == '#') {
392.     captionLocation = captionLocation.substring(1, captionLocation.length);
393. }
394. captionHTML = $(captionLocation).html(); //get HTML from the matching HTML entity

I haven't tested to see if this breaks anything else, but it does fix the caption issues from "http://stackoverflow.com/questions/14058409/orbit-slider-captions-not-displaying" and "#1268."

@mattnworb
Copy link
Author

@alvinsiu I think what you suggest makes a lot of sense. Sorry about any accidental breakages as a result of my fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants