-
Notifications
You must be signed in to change notification settings - Fork 596
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
Option to use original DOM elements instead of clones #339
Comments
We don't want to add more complexity to the library, in addition to this, it is very difficult to be able to position the original div as a side menu depending on the situation of that DIV in the DOM. The reason to clone the div is to be able to put it wherever we want in the DOM. Why can't you just add the same JS events to the copied content? What are the other complex things? |
I wrote a Sidr + Drupal integration. Things seem to be going fine for basic use cases. However, for complex things like forms, I'm afraid it might lead to problems for certain types of Drupal content, like forms, etc. Besides, I see that the plugin currently clones the inner HTML of the |
Same problem here, also for me in Drupal ( 8 ). |
Hey francesco. I have added a configuration to the 8.x-2.x version of the sidr module for drupal to allow this (along with many accessibility fixes) . Please try it and let me know if it works for you. The contents lose their JavaScript events though, I will fix that later today or this weekend. I hope this answer helps. |
Expected Behavior
Sometimes, people create a hidden
DIV
element with menu content and expect that entireDIV
to be used in the sidr exactly as-is because they have JavaScript events and other complex things attached to the originalDIV
.Current Behavior
There is no way an original DOM element can be included in the
sidr
. A copy of the original element is always created, with an option ofrenaming
IDs.Possible Solution
Provide an option named
noCopy
oruseOriginal
orappendSource
which when set totrue
should make Sidr get items found by thesource
jQuery selector and append those original elements in to the sidr element.The text was updated successfully, but these errors were encountered: