-
Notifications
You must be signed in to change notification settings - Fork 27.4k
feat(jqLite): implement width() and height() #4078
Conversation
Thanks for the PR!
If you need to make changes to your pull request, you can update the commit with Thanks again for your help! |
Signed CLA as Caitlin Potter. We'll see if it actually matters, though :) I'm not too sure this sort of thing would be merged. |
Thanks @caitp! I'm not entirely sure where we draw the line for what we're willing to add to jqLite, but this gets a +1 from me. |
@btford was wondering if there were some guidelines around what will be considered for jqlite. Seems everyone's got their own favorites (was looking for select & focus today). |
it's clear that not everything from jquery could be integrated, but I'd be interested in hearing where exactly the bar sits in terms of what is doable and what isn't, as well. I think a lot of the features which are appearing in PRs lately are generally pretty trivial, though |
Ideally, we'd just use jQuery custom builds and you could include/exclude whatever features you wanted. Hopefully we'll be able to do this some time in the future. We briefly looked into it, but it's unfortunately not totally straightforward yet. |
Thanks for the reply. I was thinking about this last night... If jqlite included only the API bits that angularjs used, it would provide an interesting bit of documentation. It gets muddy fast when APIs are added anticipating needs outside of the core. Today, people can create a custom jquery build on their own and have angular just use that. I'm in a bit of a hard place in that I'm including angular 1.2 into an app that has jquery.reallyold, so I just force angular to use jqlite and so I am a bit restricted. |
I'm not sure I like the idea of the "custom jQuery build" idea, because I would see this as being extremely difficult to support, and could cause all sorts of annoyance with the idea of using angular modules as "web components", but that's just my 2c. It would be cool to have a build step which simply removes closures/code which is never referenced in the app, but I don't think it would really be a good idea to make this part of the development process itself (again, just my 2c) |
I'm sorry, but I wasn't able to verify your CLA signature. CLA signature is required for any code contributions to AngularJS. Please sign our CLA and ensure that the CLA signature email address and the email address in this PR's commits match. If you signed the CLA as a corporation, please let me know the company's name. Thanks a bunch! PS: If you signed the CLA in the past then most likely the email addresses don't match. Please sign the CLA again or update the email address in the commit of this PR. |
CLA signature verified! Thank you! Someone from the team will now triage your PR and it will be processed based on the determined priority (doc updates and fixes with tests are prioritized over other changes). |
👏 |
Provides a simple mechanism to query the pixel height and width of an element, regardless of whether or not it is hidden in some fashion or not. Additionally, jqLite.css() now leverages `getComputedStyle` if it is available.
👍 Full set of properties (.height() .innerHeight() .outerHeight([includeMargin]), etc.) more useful because We can use offsetHeight/Width by native JS without height(), width(). But inner/outerHeight more difficult function and we need helpers |
02dc2aa
to
fd2d6c0
Compare
Target milestone: After 1.2 release.
These are fairly commonly used DOM manipulation methods, which are sorely missing from jqLite.
The implementations provided here are much simpler than jQuery's implementations, relying only on offsetWidth and offsetHeight, and performing no special operation for document elements or other special cases.
However, they do provide some basic essentials, and this is a good thing.
Also implemented in this patch: jqLite.css() will now leverage
getComputedStyle
if it is available, before relying on the inline style. This is necessary to provide a more robust means of determining whether or not an element is visible or not, whichheight()
/width()
need to know.