diff --git a/app/coffee/modules/common/estimation.coffee b/app/coffee/modules/common/estimation.coffee index 3b03a587..f8666078 100644 --- a/app/coffee/modules/common/estimation.coffee +++ b/app/coffee/modules/common/estimation.coffee @@ -203,7 +203,10 @@ EstimationsService = ($template, $qqueue, $repo, $confirm, $q) -> point.selected = if @us.points[roleId] == point.id then false else true return point - html = pointsTemplate({"points": points, roleId: roleId}) + maxPointLength = 5 + horizontalList = _.some points, (point) => point.name.length > maxPointLength + + html = pointsTemplate({"points": points, roleId: roleId, horizontal: horizontalList}) # Remove any previous state @$el.find(".popover").popover().close() @$el.find(".pop-points-open").remove() diff --git a/app/partials/common/estimation/us-estimation-points.jade b/app/partials/common/estimation/us-estimation-points.jade index 1fb05d0b..8440a616 100644 --- a/app/partials/common/estimation/us-estimation-points.jade +++ b/app/partials/common/estimation/us-estimation-points.jade @@ -1,4 +1,4 @@ -ul.popover.pop-points-open +ul.popover.pop-points-open(class!="<% if (horizontal) { %>horizontal<% }; %>") <% _.each(points, function(point) { %> li <% if (point.selected) { %> diff --git a/app/styles/components/popover-points.scss b/app/styles/components/popover-points.scss new file mode 100644 index 00000000..63903eee --- /dev/null +++ b/app/styles/components/popover-points.scss @@ -0,0 +1,10 @@ +// This file should contain in future all the common styles for the points popover + +.popover.pop-points-open { + &.horizontal { + li { + white-space: nowrap; + width: 100%; + } + } +} diff --git a/app/styles/layout/us-detail.scss b/app/styles/layout/us-detail.scss index 1ff3c9f1..ae06ec79 100644 --- a/app/styles/layout/us-detail.scss +++ b/app/styles/layout/us-detail.scss @@ -323,6 +323,7 @@ @include popover(200px, $top: 105%, $left: -160px, $arrow-width: 10px, $arrow-top: -5px, $arrow-left: 90%, $arrow-height: 10px); } } + } .duty-data-container { diff --git a/app/styles/modules/common/lightbox.scss b/app/styles/modules/common/lightbox.scss index 9824ce43..7a9f4adb 100644 --- a/app/styles/modules/common/lightbox.scss +++ b/app/styles/modules/common/lightbox.scss @@ -95,11 +95,6 @@ display: none; } } - .points-per-role { - .popover { - @include popover(200px, $top: 105%, $left: 35%, $arrow-width: 10px, $arrow-top: -5px, $arrow-left: 10px); - } - } } .lightbox-generic-bulk { diff --git a/main-sass.js b/main-sass.js index 1f266882..780eb2e7 100644 --- a/main-sass.js +++ b/main-sass.js @@ -56,6 +56,7 @@ exports.files = function () { 'components/beta', 'components/markitup', 'components/markdown-help', + 'components/popover-points', //#################################################