-
Notifications
You must be signed in to change notification settings - Fork 4
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
Make it an object (fixes #5) #7
Conversation
convert to Array rather than NodeList
Fixes #5 (GitHub does not register the reference in the title for some reason) |
Does it support chaining? Example: $("div").css("background-color:green;").html("Hello World") |
The methods that don't return a value support chaining, yes. Methods with In any object, |
I should remind you that this code is entirely untested. |
Try to test this with your code: $("div").css("background-color:green;").html("Hello World"); |
I was half-expecting you to test it for me since you're the maintainer and you know what's best, but sure, I'll try that. |
I just did :) |
Yes the css will work, what about html? Every div should display: "Hello World". |
Good point. I'll look into it |
So it turns out arrow functions preserve the |
Okay, I made a few updates. I made chaining work and added more argument types. You can now do stuff like
Yay |
Ok.. I hope the result is different from my previous project https://github.com/vladocar/nanoJS/blob/master/src/nanoJS.js :) |
Yep, it is, don't worry :) I'd love to become a maintainer here if that's possible! I tested both the minified and non-minified versions of my latest commit and they both work. |
Ok, much better 👍 Now I need to rewrite the docs and I will approve it.. |
You won't have to rewrite them fully, I hope. |
I could rewrite them for you if you like. Where are they stored? I could add them to the PR Edit: Nevermind, they're on a different branch. It's identical here though. I could add the latest commit from |
Unfortunately I do. All in the interest of not polluting the global object. |
Do you have any IM like Discord? This PR is getting loooong |
Yeah you are right. Just Skype.. I hope to finish with the docs today. |
Make a Gitter then? |
gitter.im/femtoJS |
Did a bunch of stuff, maintainer approved, waiting on merge now |
Incorporates the
parent
method from #6 (sorry, referenced issue 4 accidentally before)sel
method for getting the now-scoped selection as a regular array of nodesoffset()
now returns the offset of the first element rather than setting a global variable to the offset of the lastgetAttr()
now works, it returns the attribute gotten from the first element rather than being a no-opforEach
because it's shorter than thefor
loops, but the downside is that you can't use automated minification anymoreThis does not use proper classes with prototypes and things, because I was lazy. This is better than what the library was previously in any case. Let me know if you'd like me to revert any of these changes. This is completely untested though, so merge at your own risk
Note, this does not update the
lib
directory