-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add ability to optionally traverse the DOM #70
Comments
Hey @rodrigoaguilera, Thank you for the suggestion. I've been thinking about this. Rather than splitting that bit into it's own file I think the best way is to do something like this: window.bulmaOptions = {
autoParseDocument: false // default is true
} If the above is included before the BulmaJS script is executed the core can check and prevent the automatic DOM parsing from running. This also prevents minimal changes to how the core works, as if someone wishes to manually cause the DOM parsing to run they can still call
I do like this idea, as it would provide a way to scope the parsing should the flexibility be required. I think expanding the What do you think of the above changes? Would that work for you, it would also help improve the flexibility of the library for others integrating it into a different platform, similar to yourself. |
I like the bulmaOptions idea even better! Everything sounds good and it feels like the changes would be minimal. |
Hey @rodrigoaguilera Thank you again for your suggestion. Both of these features are now in master and will be included in the next |
Woah, thanks to you! I will try it soon |
I'm trying to integrate this library with the Drupal Javascript system in the following project
https://www.drupal.org/project/drulma
and I want to avoid unnecessary calls to traverseDOM. The dom is traversed on the loading of Bulmajs, then when I load this concept of "Drupal behaviors" and then after every ajax call that modifies markup.
Solution that I'd like
I am not very experienced with javascript modules but maybe separate this piece
from the core to a BulmajsInit file.
I think this will also benefit people who only use the library to make JS calls and do not want the markup inspected.
Another cool addition to the traverseDOM function (or separate it to a different method) would be the possibility to start traversing from a different element instead of
document
in case you know what parts need to be traversed (again, when drupal load a new piece of markup with ajax).What do think?
Great work with the project :)
The text was updated successfully, but these errors were encountered: