Skip to content

Fix for invalid 'platform' #443

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

Merged
merged 1 commit into from
Jun 9, 2017

Conversation

montymxb
Copy link
Contributor

@montymxb montymxb commented Jun 9, 2017

This is a patch for the observed issue in #442, where common sections with multiple code samples would default to always showing JS no matter the current sdk.

Originally, before the docs were at docs.parseplatform.org they used to be at parseplatform.org/docs (if I believe correctly). When determining which set of code snippets to display the JS pulled the platform 'name' from the url as follows

var platform = window.location.pathname.split('/')[2];

Now that docs are served using the docs subdomain instead of the docs directory this retrieves the directory 1 past the intended platform name. The new result was just returning guide for every page. Since this is not a valid platform the 'common' language block to show would fall back to the default case, which also happens to be the JS case.

case 'js':
default:
    $('.common-lang-block.js').show();

The fix is just a one liner accounting for the now absent docs directory, simply changing the index of the split pathname to 1 instead of 2.

@flovilmart flovilmart merged commit 4838e92 into parse-community:gh-pages Jun 9, 2017
@flovilmart
Copy link
Contributor

Let's see if it's all 😊

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.

2 participants