Merge pull request #476 from sharelatex/ja-use-new-comment-button

Fix on the new comment button variation
This commit is contained in:
James Allen 2017-04-05 11:08:59 +01:00 committed by GitHub
commit 477278eea5
5 changed files with 10 additions and 37 deletions

View file

@ -20,7 +20,6 @@ div.full-size(
'rp-size-expanded': ui.reviewPanelOpen,\
'rp-layout-left': reviewPanel.layoutToLeft,\
'rp-loading-threads': reviewPanel.loadingThreads,\
'rp-new-comment-ui': reviewPanel.newAddCommentUI\
}"
)
.loading-panel(ng-show="!editor.sharejs_doc || editor.opening")

View file

@ -8,7 +8,7 @@
) !{translate("track_changes_is_on")}
a.rp-add-comment-btn(
href
ng-if="reviewPanel.newAddCommentUI && reviewPanel.entries[editor.open_doc_id]['add-comment'] != null"
ng-if="reviewPanel.entries[editor.open_doc_id]['add-comment'] != null"
ng-click="addNewComment();"
)
i.fa.fa-comment
@ -81,8 +81,6 @@
on-start-new="startNewComment();"
on-submit="submitNewComment(content);"
on-cancel="cancelNewComment();"
on-indicator-click="toggleReviewPanel();"
layout-to-left="reviewPanel.layoutToLeft"
)
.rp-entry-list(
@ -322,14 +320,6 @@ script(type='text/ng-template', id='resolvedCommentEntryTemplate')
script(type='text/ng-template', id='addCommentEntryTemplate')
div
.rp-entry-callout.rp-entry-callout-add-comment
.rp-entry-indicator.rp-entry-indicator-add-comment(
ng-if="!commentState.adding"
ng-click="startNewComment(); onIndicatorClick();"
tooltip=translate("add_comment")
tooltip-placement="{{ layoutToLeft ? 'left' : 'right' }}"
tooltip-append-to-body="true"
)
i.fa.fa-commenting
.rp-entry.rp-entry-add-comment(
ng-class="[ (state.isAdding ? 'rp-entry-adding-comment' : ''), (entry.focused ? 'rp-entry-focused' : '')]"
)

View file

@ -4,7 +4,7 @@ define [
"ide/colors/ColorManager"
"ide/review-panel/RangesTracker"
], (App, EventEmitter, ColorManager, RangesTracker) ->
App.controller "ReviewPanelController", ($scope, $element, ide, $timeout, $http, $modal, event_tracking, sixpack, localStorage) ->
App.controller "ReviewPanelController", ($scope, $element, ide, $timeout, $http, $modal, event_tracking, localStorage) ->
$reviewPanelEl = $element.find "#review-panel"
$scope.SubViews =
@ -24,17 +24,8 @@ define [
loading: false
commentThreads: {}
resolvedThreadIds: {}
layoutToLeft: false
rendererData: {}
loadingThreads: false
newAddCommentUI: false # Test new UI for adding comments; remove afterwards.
$scope.shouldABAddCommentBtn = false
if $scope.user.signUpDate >= '2017-03-27'
sixpack.participate "add-comment-btn", [ "default", "editor-corner" ], (variation) ->
$scope.shouldABAddCommentBtn = true
$scope.variationABAddCommentBtn = variation
$scope.reviewPanel.newAddCommentUI = (variation == "editor-corner")
window.addEventListener "beforeunload", () ->
collapsedStates = {}
@ -45,11 +36,9 @@ define [
localStorage("docs_collapsed_state:#{$scope.project_id}", valToStore)
$scope.$on "layout:pdf:linked", (event, state) ->
$scope.reviewPanel.layoutToLeft = (state.east?.size < 220 || state.east?.initClosed)
$scope.$broadcast "review-panel:layout"
$scope.$on "layout:pdf:resize", (event, state) ->
$scope.reviewPanel.layoutToLeft = (state.east?.size < 220 || state.east?.initClosed)
$scope.$broadcast "review-panel:layout", false
$scope.$on "expandable-text-area:resize", (event) ->
@ -59,9 +48,6 @@ define [
$scope.$on "review-panel:sizes", (e, sizes) ->
$scope.$broadcast "editor:set-scroll-size", sizes
$scope.$watch "ui.pdfLayout", (layout) ->
$scope.reviewPanel.layoutToLeft = (layout == "flat")
$scope.$watch "project.features.trackChangesVisible", (visible) ->
return if !visible?
if !visible
@ -173,7 +159,7 @@ define [
entries = $scope.reviewPanel.entries[$scope.editor.open_doc_id] or {}
permEntries = {}
for entry, entryData of entries
if entry != "add-comment" or !$scope.reviewPanel.newAddCommentUI
if entry != "add-comment"
permEntries[entry] = entryData
Object.keys(permEntries).length
), (nEntries) ->
@ -336,8 +322,6 @@ define [
$scope.$broadcast "comment:select_line"
$timeout () ->
$scope.$broadcast "review-panel:layout"
if $scope.shouldABAddCommentBtn and !$scope.ui.reviewPanelOpen
sixpack.convert "add-comment-btn"
$scope.submitNewComment = (content) ->
return if !content? or content == ""

View file

@ -8,8 +8,6 @@ define [
onStartNew: "&"
onSubmit: "&"
onCancel: "&"
onIndicatorClick: "&"
layoutToLeft: "="
link: (scope, element, attrs) ->
scope.state =
isAdding: false

View file

@ -96,10 +96,12 @@
flex-direction: column;
width: @review-panel-width;
overflow: visible;
border-left-width: 1px;
}
.rp-size-mini & {
width: @review-off-width;
z-index: 6;
border-left-width: 1px;
}
position: absolute;
@ -107,7 +109,7 @@
bottom: 0px;
right: 0px;
background-color: @rp-bg-blue;
border-left: solid 1px @rp-border-grey;
border-left: solid 0px @rp-border-grey;
font-size: @rp-base-font-size;
color: @rp-type-blue;
z-index: 6;
@ -181,6 +183,9 @@
.rp-size-mini & {
display: block;
}
.rp-size-mini &-add-comment {
display: none;
}
position: absolute;
left: 2px;
right: 2px;
@ -200,9 +205,6 @@
z-index: 1;
}
.rp-new-comment-ui &-add-comment {
display: none;
}
}
.rp-entry-wrapper {
@ -576,7 +578,7 @@
}
}
.rp-size-mini.rp-new-comment-ui &-add-comment {
.rp-size-mini &-add-comment {
display: none;
}
}