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

Changed Markdown.Editor.js to be friendly with Rails id-based parameter paradigm. #2

Merged
merged 4 commits into from Dec 10, 2012
Merged

Conversation

lpeabody
Copy link
Contributor

PageDown utilizes the ID attribute for particular elements in order to setup various "panels". One of these panels is the input panel. It grabs the id for a text area element and uses that as the markdown input.

The library expects a text area with the id of wmd-input to be the element which receives the markdown input from the user. This is problematic, especially if you want a particular model's field to be the markdown input (since it already has it's id assigned by Rails naming convention).

To fix this, I modified the PanelCollection function within Markdown.Editor. I changed the DOM element being searched for the input to match a particular class name rather than a particular id. This eliminates the id conflict with Rails' naming conventions.

Here's the Stack Overflow conversation where the fork and change originated from http://stackoverflow.com/questions/13792956/change-existing-javascript-object-functions-with-prototype

…t element from the DOM based on class name rather than ID, so it doesn't interfere with Rails ID-centric parameter passing.
rh added a commit that referenced this pull request Dec 10, 2012
Changed Markdown.Editor.js to be friendly with Rails id-based parameter paradigm.
@rh rh merged commit a3383e9 into rh:master Dec 10, 2012
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.

None yet

2 participants