Fixed estimation for user stoy detail
parent
093508bb8a
commit
ddfbf22066
|
@ -200,15 +200,23 @@ $.fn.popover = () ->
|
|||
docViewTop = $(window).scrollTop()
|
||||
docViewBottom = docViewTop + $(window).height()
|
||||
|
||||
docViewWidth = $(window).width()
|
||||
docViewRight = docViewWidth
|
||||
docViewLeft = 0
|
||||
|
||||
elemTop = $el.offset().top
|
||||
elemBottom = elemTop + $el.height()
|
||||
|
||||
elemWidth = $el.width()
|
||||
elemLeft = $el.offset().left
|
||||
elemRight = $el.offset().left + elemWidth
|
||||
|
||||
$el.css({
|
||||
"display": "none",
|
||||
"visibility": "visible"
|
||||
})
|
||||
|
||||
return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop))
|
||||
return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop) && (elemLeft >= docViewLeft) && (elemRight <= docViewRight))
|
||||
|
||||
closePopover = (onClose) =>
|
||||
if onClose then onClose.call($el)
|
||||
|
@ -234,8 +242,7 @@ $.fn.popover = () ->
|
|||
if !isVisible()
|
||||
$el.addClass("fix")
|
||||
|
||||
$el
|
||||
.fadeIn () =>
|
||||
$el.fadeIn () =>
|
||||
$el.addClass("active")
|
||||
$(document.body).off("popover")
|
||||
|
||||
|
|
|
@ -271,13 +271,14 @@ UsStatusDetailDirective = () ->
|
|||
updatingSelectedRoleId = null
|
||||
$ctrl = $el.controller()
|
||||
|
||||
showSelectPoints = (onClose) ->
|
||||
showSelectPoints = (target) ->
|
||||
us = $model.$modelValue
|
||||
$el.find(".pop-points-open").remove()
|
||||
$el.find(".points-per-role").append(selectionPointsTemplate({ "points": $scope.project.points }))
|
||||
$el.find(target).append(selectionPointsTemplate({ "points": $scope.project.points }))
|
||||
target.removeClass('active')
|
||||
$el.find(".pop-points-open a[data-point-id='#{us.points[updatingSelectedRoleId]}']").addClass("active")
|
||||
# If not showing role selection let's move to the left
|
||||
$el.find(".pop-points-open").popover().open(onClose)
|
||||
$el.find(".pop-points-open").popover().open()
|
||||
|
||||
calculateTotalPoints = (us)->
|
||||
values = _.map(us.points, (v, k) -> $scope.pointsById[v].value)
|
||||
|
@ -349,7 +350,8 @@ UsStatusDetailDirective = () ->
|
|||
updatingSelectedRoleId = target.data("role-id")
|
||||
target.siblings().removeClass('active')
|
||||
target.addClass('active')
|
||||
showSelectPoints(() -> target.removeClass('active'))
|
||||
showSelectPoints(target)
|
||||
|
||||
$el.on "click", ".point", (event) ->
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
|
|
|
@ -195,8 +195,8 @@
|
|||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.pop-points-open {
|
||||
@include popover(200px, 60px, 40px, '', '');
|
||||
.popover {
|
||||
@include popover(200px, $top: 105%, $left: 35%, $arrow-width: 10px, $arrow-top: -5px, $arrow-left: 10px);
|
||||
li {
|
||||
display: inline-block;
|
||||
width: 23%;
|
||||
|
@ -210,6 +210,9 @@
|
|||
color: $white;
|
||||
}
|
||||
}
|
||||
&.fix {
|
||||
@include popover(200px, $top: 105%, $left: -160px, $arrow-width: 10px, $arrow-top: -5px, $arrow-left: 90%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,6 @@
|
|||
.points-per-role {
|
||||
.popover {
|
||||
@include popover(200px, $top: 105%, $left: 35%, $arrow-width: 10px, $arrow-top: -5px, $arrow-left: 10px);
|
||||
color: orange;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue