Fix select copy in diff for Polymer 2
Move all diff content related styles into same place in gr-diff.html
Bug: Issue 11318
Change-Id: I1ea1b7ee8682d137f7602b0c61e520fa9e56c339
diff --git a/polygerrit-ui/app/elements/diff/gr-diff/gr-diff.html b/polygerrit-ui/app/elements/diff/gr-diff/gr-diff.html
index 2d16a4b..3399062 100644
--- a/polygerrit-ui/app/elements/diff/gr-diff/gr-diff.html
+++ b/polygerrit-ui/app/elements/diff/gr-diff/gr-diff.html
@@ -305,6 +305,30 @@
.lineNum.PARTIALLY_COVERED {
background: linear-gradient(to right bottom, #FFD1A4 0%, #FFD1A4 50%, #E0F2F1 50%, #E0F2F1 100%);
}
+
+ /** Select to copy */
+ .content,
+ .contextControl,
+ .blame {
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ }
+
+ .selected-left:not(.selected-comment) .side-by-side .left + .content .contentText,
+ .selected-right:not(.selected-comment) .side-by-side .right + .content .contentText,
+ .selected-left:not(.selected-comment) .unified .left.lineNum ~ .content:not(.both) .contentText,
+ .selected-right:not(.selected-comment) .unified .right.lineNum ~ .content .contentText,
+ .selected-left.selected-comment .side-by-side .left + .content .message,
+ .selected-right.selected-comment .side-by-side .right + .content .message :not(.collapsedContent),
+ .selected-comment .unified .message :not(.collapsedContent),
+ .selected-blame .blame {
+ -webkit-user-select: text;
+ -moz-user-select: text;
+ -ms-user-select: text;
+ user-select: text;
+ }
</style>
<style include="gr-syntax-theme"></style>
<div id="diffHeader" hidden$="[[_computeDiffHeaderHidden(_diffHeaderItems)]]">