Add a backdrop to the dropdown (to close when clicked outside).

This commit is contained in:
Paulo Reis 2017-01-11 10:53:46 +00:00
parent 72baed60ef
commit 931187bd8b
3 changed files with 18 additions and 19 deletions

View file

@ -256,10 +256,10 @@ script(type='text/ng-template', id='addCommentEntryTemplate')
script(type='text/ng-template', id='resolvedCommentsDropdownTemplate')
.resolved-comments
//- .resolved-comments-backdrop(
//- ng-class="{ 'resolved-comments-backdrop-visible' : state.isOpen }"
//- ng-click="state.isOpen = !state.isOpen"
//- )
.resolved-comments-backdrop(
ng-class="{ 'resolved-comments-backdrop-visible' : state.isOpen }"
ng-click="state.isOpen = false"
)
a.resolved-comments-toggle(
href
ng-click="toggleOpenState();"

View file

@ -251,8 +251,7 @@ define [
$timeout () ->
$scope.$broadcast "review-panel:layout"
$scope.submitReply = (entry, entry_id) ->
$scope.unresolveComment(entry, entry_id)
$scope.submitReply = (entry, entry_id) ->
thread_id = entry.thread_id
content = entry.replyContent
$http.post("/project/#{$scope.project_id}/thread/#{thread_id}/messages", {content, _csrf: window.csrfToken})

View file

@ -93,6 +93,7 @@
border-left: solid 1px @rp-border-grey;
font-size: @rp-base-font-size;
color: @rp-type-blue;
z-index: 4; // 3 is Ace's gutter z-index value.
}
.review-panel-toolbar {
@ -112,7 +113,7 @@
border-bottom: 1px solid @rp-border-grey;
background-color: @rp-bg-dim-blue;
text-align: center;
z-index: 2;
z-index: 3;
flex-basis: 32px;
flex-shrink: 0;
}
@ -687,19 +688,18 @@
}
}
// .resolved-comments-backdrop {
// display: none;
// position: fixed;
// top: 0;
// right: 0;
// bottom: 0;
// left: 0;
// background-color: rgba(0, 0, 0, .5);
.resolved-comments-backdrop {
display: none;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
// &-visible {
// display: block;
// }
// }
&-visible {
display: block;
}
}
.resolved-comments-dropdown {
display: none;