diff options
| author | Neylor Ohmaly | 2014-02-10 00:25:53 -0200 | 
|---|---|---|
| committer | Neylor Ohmaly | 2014-02-10 00:25:53 -0200 | 
| commit | f62db567d999f50a09947a0d6478a205f60ba03c (patch) | |
| tree | 5a2039d3bca58c403e9c61a4b52196b280b13ba9 /src | |
| parent | 20c5741f5f3b2e4ad3f579082e78725f4ea26c85 (diff) | |
| download | nsPopover-0.5.5.tar.bz2 | |
Fix error on the right|bottom and left|bottom alignment0.5.5
Diffstat (limited to 'src')
| -rw-r--r-- | src/nsPopover.js | 15 | 
1 files changed, 8 insertions, 7 deletions
| diff --git a/src/nsPopover.js b/src/nsPopover.js index f55aad9..1e8aad1 100644 --- a/src/nsPopover.js +++ b/src/nsPopover.js @@ -196,23 +196,24 @@            var positionY = function() {
              if (align === 'center') {
                return Math.round(rect.top + rect.height/2 - popoverRect.height/2);
 -            } else {
 -              return rect[align];
 +            } else if(align === 'bottom') {
 +              return rect.bottom - popoverRect.height;
              }
 +            return rect.top;
            };
            if (placement === 'top') {
 -            top = rect.top - popoverRect.height - 1;
 +            top = rect.top - popoverRect.height;
              left = positionX();
            } else if (placement === 'right') {
              top = positionY();
 -            left = rect.right +1;
 +            left = rect.right;
            } else if (placement === 'bottom') {
 -            top = rect.bottom + 1;
 +            top = rect.bottom;
              left = positionX();
            } else if (placement === 'left') {
              top = positionY();
 -            left = rect.left - popoverRect.width - 1;
 +            left = rect.left - popoverRect.width;
            }
            popover
 @@ -225,7 +226,7 @@                triangle.css('left', left.toString() + 'px');
              } else {
                top = rect.top + rect.height / 2 - top;
 -              triangle.css('top',  + 'px');
 +              triangle.css('top', top.toString()  + 'px');
              }
            }
          }
 | 
