-
Notifications
You must be signed in to change notification settings - Fork 27.4k
feat(jqLite): Add offset method to jqLite #3799
Conversation
PR Checklist (Minor Feature)
|
@steelsojka I've added this to the post-1.2 milestone, which means it will likely get reviewed after 1.2 has been released. In the meantime, would you mind squashing your commits into one commit? See our Contributor Guidelines for more info. |
No problem. I will get to it here sometime later today.
|
Add the method offset to jqlite to retrieve the elements top and left position. Using the method as a setter is not supported.
+1 on this ... angular-ui/bootstrap#1049 is sort of related. It would really be ideal to put everything from the I'd personally really like to see a few other common DOM helpers added into jqlite, just to make life a bit easier for ui-bootstrap developers. I realize fully well that core angular wouldn't have much of a use for them, but it would be a big deal for directives when we can't depend on jquery being available. I suppose I may write a patch to provide |
What's the status of this issue? |
I think it's still ready to go. I don't think it's to high priority right now is my guess, since you can just include jQuery. |
02dc2aa
to
fd2d6c0
Compare
cad9560
to
f294244
Compare
e8dc429
to
e83fab9
Compare
4dd5a20
to
998c61c
Compare
@steelsojka It looks like this needs a rebase |
Why is this not merged yet? |
|
||
documentElem = doc.documentElement; | ||
|
||
if ( typeof element.getBoundingClientRect !== undefined ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the if
is necessary anymore; we even dropped it in jQuery and Angular supports fewer browsers.
This PR has been lying here in the backlog for almost 2 years now and we haven't seen huge demand for this method among Angular users so we decided to not add this method. It's always hard to decide what to include and what not but jqLite's goal is mainly to include methods needed for core Angular to work; if people want more methods from jQuery they can include jQuery directly. With custom jQuery compilations (you can e.g. exclude ajax, deferred, callbacks modules etc. as Angular apps shouldn't need them) the final size is smaller than the full file. For example, when compiling the current
you'll be down to 20.5 KB gzipped. If you also exclude Sizzle, jQuery selector engine (at the cost of making For comparison, Angular.js (without additional modules like route, animate etc.) is 54 KB gipped and jqLite that's included in it is 5 KB gzipped. Thanks for your efforts! |
Add offset method to jqLite as a getter only to retrieve element
position.