Просмотр исходного кода

Show add comment button when review panel is off.

Paulo Reis 10 лет назад
Родитель
Сommit
8a11c8c3ca

+ 15 - 4
services/web/app/views/project/editor/editor.jade

@@ -58,10 +58,21 @@ div.full-size(
 						.rp-entry-callout(
 						.rp-entry-callout(
 							ng-class="'rp-entry-callout-' + entry.type"
 							ng-class="'rp-entry-callout-' + entry.type"
 						)
 						)
-						.rp-entry-indicator(ng-switch="entry.type") 
-							i.fa.fa-pencil(ng-switch-when="insert")
-							i.rp-icon-delete(ng-switch-when="delete")
-							i.fa.fa-comment(ng-switch-when="comment")
+
+						div(ng-switch="entry.type")
+							.rp-entry-indicator(ng-switch-when="insert")
+								i.fa.fa-pencil
+							.rp-entry-indicator(ng-switch-when="delete")
+								i.rp-icon-delete
+							.rp-entry-indicator(ng-switch-when="comment")
+								i.fa.fa-comment
+							.rp-entry-indicator(
+								ng-switch-when="add-comment"
+								ng-if="!commentState.adding"
+								ng-click="startNewComment(); toggleReviewPanel();"
+							)
+								i.fa.fa-commenting
+
 						.rp-entry(
 						.rp-entry(
 							ng-class="[ 'rp-entry-' + entry.type, (commentState.adding ? 'rp-entry-adding-comment' : ''), (entry.focused ? 'rp-entry-focused' : '')]"
 							ng-class="[ 'rp-entry-' + entry.type, (commentState.adding ? 'rp-entry-adding-comment' : ''), (entry.focused ? 'rp-entry-focused' : '')]"
 						)
 						)

+ 15 - 2
services/web/public/stylesheets/app/editor/review-panel.less

@@ -113,7 +113,9 @@
 }
 }
 
 
 .rp-entry-wrapper {
 .rp-entry-wrapper {
-	&:hover > .rp-entry {
+	&:hover > .rp-entry-insert,
+	&:hover > .rp-entry-delete,
+	&:hover > .rp-entry-comment {
 		display: block;
 		display: block;
 	}
 	}
 }
 }
@@ -148,7 +150,7 @@
 		border-color: @rp-yellow;
 		border-color: @rp-yellow;
 	}
 	}
 
 
-	&-focus-position {
+	&-add-comment {
 		background-color: transparent;
 		background-color: transparent;
 		right: auto;
 		right: auto;
 		border-left-width: 0;
 		border-left-width: 0;
@@ -429,6 +431,17 @@
 					right: 10px;
 					right: 10px;
 					z-index: 1;
 					z-index: 1;
 				}
 				}
+
+				&-add-comment {
+					right: auto;
+					width: auto;
+
+					&.rp-entry-adding-comment {
+						right: 5px;
+					}
+				}
+
+
 			}
 			}
 
 
 			.rp-entry-indicator {
 			.rp-entry-indicator {