nohros / nsPopover

Popover dialogs for angularjs applications.
MIT License
126 stars 107 forks source link

Top/Bottom Alignment Incorrectly Positions Triangle #118

Open ghost opened 7 years ago

ghost commented 7 years ago

When using ANY|top or ANY|bottom with ns-popover-placement the Triangle is positioned essentially at top:0, or bottom:0.

This is EXACTLY what's happening, but it's the end-result.

As a solution, I was able to correct with:

.ns-popover-tooltip-theme {
  &.ns-popover-top-align {
    .ns-popover-tooltip {
      margin-top: -$popover-triangle-size;
    }
  }

  &.ns-popover-bottom-align {
    .ns-popover-tooltip {
      margin-bottom: -$popover-triangle-size;
    }
  }
}

The key trick is offsetting by -$popover-triangle-size

I think this is an easy fix and doesn't need much testing to merge in.