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

Already on GitHub? Sign in to your account

Fixes potential issues with inline scripts #123

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
1 participant

nelsonad commented Jan 6, 2012

This change reorders the dom manipulation slightly.

Element children will not be added back to the scroll pane until after the scroll pane has been added to the dom tree first.

Owner

nelsonad commented on c8131d1 Jan 6, 2012

This fixes an issue that exists if the element getting jScrollPane'd has inline script that expects elements to be in the dom.

example:
document.getElementById('childElementOfScrollPane').style.display = "none";

The code above will result in a javascript error because the element will be null in previous code execution, because it's being appended to an element that is not yet in the dom tree.

This is resolved by creating the wrapper elements first, appending them to the target, and then readding the targets children after (inline scripts will be executed here via jquery append method).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment