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

adding copy method with url change #47

Merged
merged 3 commits into from
Nov 16, 2015
Merged

Conversation

horans
Copy link
Contributor

@horans horans commented Nov 13, 2015

allow user directly switch to certain copy method from url parameters.
the new setCopy() works just like setLibrary().

setCopy() functions almost they same way as setLibrary().
improved user experience since last commit.
@thomaspark
Copy link
Owner

@horans, this is fantastic. Thanks for the contribution!

@thomaspark
Copy link
Owner

Spotted a small bug: when you delete the copy argument in the URL, the "markup" button is highlighted but what's actually copied is whatever was last selected.

@horans
Copy link
Contributor Author

horans commented Nov 16, 2015

i guess its something to do with line 28:
setState("library", qs.library);
i added the line underneath without thinking:
setState("copy", qs.copy);

then, the "state[copy]" will turn "undefined" if the query string is not having "copy=". (same as the "state[library]")

how about change these two lines into:
setState("library", qs.library || "all");
and
setState("copy", qs.copy || "markup");
to set the default value.

when query string is empty, setState() will set "state[prop]" to "undefined".
@thomaspark
Copy link
Owner

That should do the trick, and makes lines 40 and 76 redundant.

thomaspark added a commit that referenced this pull request Nov 16, 2015
adding copy method with url change
@thomaspark thomaspark merged commit 82ec28f into thomaspark:gh-pages Nov 16, 2015
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