-
Notifications
You must be signed in to change notification settings - Fork 29
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
returning htmlParentNode (or Parent) twice returns the parentnode's parent. #25
Comments
I had the same issue, and to easily fix it, I did this :
Note : you need to reset the `parentelm` value to `undefined` each time you switch to an other editable element. Otherwise, the parent will not change and the button will act to the first editable element's parent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
when I repeatedly click my button I first get the actual htmlParentNode but on second and subsequent click I get a div that is the htmlParentNode's parent:
am i doing something wrong or is this a bug?
could it be as the parent is now of the menu button and not the editor div? ie this:
var sel = window.getSelection(); var parent = sel.anchorNode.parentElement;
I'm actually trying to get the id of the div that the editor instance is attached to as I have a page with many editors/ divs of editable class - is there an easy way to do that? (my goal is ajax with many editable divs).
thanks
----- edit - i'm pretty sure the parent of parent is being returned. here's a kludgy workaround
The text was updated successfully, but these errors were encountered: