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

Merged
merged 4 commits into from Dec 10, 2012

Projects

None yet

2 participants

@lpeabody

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

lpeabody added some commits Dec 9, 2012
@lpeabody lpeabody Modified markdown.editor.js PanelCollection function to grab the inpu…
…t element from the DOM based on class name rather than ID, so it doesn't interfere with Rails ID-centric parameter passing.
891b6b7
@lpeabody lpeabody added alert f895dea
@lpeabody lpeabody changed alert b4f5808
@lpeabody lpeabody tested and working ca3fd67
@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