Cambios popover

This commit is contained in:
Juan Ferrer Toribio 2017-01-10 13:46:38 +01:00
parent 51ef2d3ef4
commit 51bc27ea30
4 changed files with 106 additions and 98 deletions

View File

@ -13,7 +13,14 @@ export function directive(resolver) {
template: function(_, attrs) {
return resolver.getTemplate(_NAME, attrs);
},
controller: function($element) {
/* link: function(scope, element, attrs, ctrl) {
var nativeElement = element[0];
nativeElement.addEventListener('click', function(ev) {
ev.preventDefault();
ctrl.show();
});
},
*/ controller: function($element) {
var self = this;
var doc = angular.element(document);
function docMouseDownHandler(event) {
@ -32,7 +39,7 @@ export function directive(resolver) {
var node = $element[0];
var style = node.style;
var spacing = 4;
var spacing = 0;
var margin = 20;
var dblMargin = margin * 2;
@ -57,7 +64,7 @@ export function directive(resolver) {
var top = rect.top + spacing + parentNode.offsetHeight;
if(left + width > innerWidth)
left -= (left + width) - window.innerWidth + margin;
left -= (left + width) - innerWidth + margin;
if(top + height > innerHeight)
top -= height + parentNode.offsetHeight + spacing * 2;

View File

@ -1,9 +1,10 @@
vn-popover {
display: none;
position: fixed;
box-shadow: 0 0 .2em rgba(1,1,1,.4);
box-shadow: 0 0 .4em rgba(1,1,1,.4);
background-color: white;
z-index: 100;
border-radius: .1em;
top: 0;
left: 0;
}