Comments (4)
I found the problem and the solution:
The problem is that the object returned by getBoundingClientRect() in IE8 don't have the field width, so in the function positionX() the line Math.round(rect.left + rect.width/2 - popoverRect.width/2); return NaN.
Solution: Don't use width and use right-left or in the function getBoundingClientRect() create a object and add the field fictitious width.
from nspopover.
I will fork the project and add the second solution
👍
from nspopover.
@iranreyes
It would be great if you can submit a pull request which addresses this issue so that other fine developers using nsPopover would enjoy this feature too. Thanks in advance.
from nspopover.
Hope this helps:
+ var returnObj = {
+ bottom: rect.bottom,
+ left: rect.left,
+ right: rect.right,
+ top: rect.top,
+ height: rect.height,
+ width: rect.width
+ };
+ if (returnObj.width === undefined) {
+ returnObj = angular.extend({}, returnObj, { width: angular.element(elm).width() });
+ }
+ if (returnObj.height === undefined) {
+ returnObj = angular.extend({}, returnObj, { height: angular.element(elm).height() });
+ }
// ClientRect class is immutable, so we need to return a modified copy
// of it when the window has been scrolled.
if (x || y) {
- return {
- bottom:rect.bottom+y,
- left:rect.left + x,
- right:rect.right + x,
- top:rect.top + y,
- height:rect.height,
- width:rect.width
- };
+ returnObj.left += x;
+ returnObj.right += x;
+ returnObj.top += y;
+ returnObj.bottom += y;
}
- return rect;
+ return returnObj;
from nspopover.
Related Issues (20)
- button component
- [Newbie] Popover doesn't show with lightbox HOT 1
- popovers won't run outsideClickHandler if another popover is clicked on
- Open nsPopover on element 2 when element 1 is clicked
- module stopped my running application HOT 1
- nsPopover misplaced tooltip rectangle (with triangle) in first click
- Resizing popover
- ns-popover-group doesn't work with click trigger
- No more releases? HOT 2
- Officially maintained on npm? HOT 2
- Could we directly use the source file HOT 3
- Top/Bottom Alignment Incorrectly Positions Triangle
- Loading template from external path is not working
- nsPopover demo wording
- ns popover popup delay, doesnt work properly
- nsPopover.js files in exmple and src directories are differente
- How can I get the popover's status of open or close by using callback?
- Dropdown onchange event closes the popover
- Is there a release coming with the latest commits? HOT 1
- Show popover in modal HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nspopover.