Merge "Make it more clear when in "edit mode""
This commit is contained in:
@@ -63,6 +63,9 @@ limitations under the License.
|
|||||||
padding: .55em var(--default-horizontal-margin);
|
padding: .55em var(--default-horizontal-margin);
|
||||||
z-index: 99; /* Less than gr-overlay's backdrop */
|
z-index: 99; /* Less than gr-overlay's backdrop */
|
||||||
}
|
}
|
||||||
|
.header.editMode {
|
||||||
|
background-color: #ebf5fb;
|
||||||
|
}
|
||||||
.header .download {
|
.header .download {
|
||||||
margin-right: 1em;
|
margin-right: 1em;
|
||||||
}
|
}
|
||||||
@@ -320,7 +323,7 @@ limitations under the License.
|
|||||||
id="mainContent"
|
id="mainContent"
|
||||||
class="container"
|
class="container"
|
||||||
hidden$="{{_loading}}">
|
hidden$="{{_loading}}">
|
||||||
<div class$="[[_computeHeaderClass(_change)]]">
|
<div class$="[[_computeHeaderClass(_editMode)]]">
|
||||||
<div class="headerTitle">
|
<div class="headerTitle">
|
||||||
<gr-change-star
|
<gr-change-star
|
||||||
id="changeStar"
|
id="changeStar"
|
||||||
|
@@ -1397,8 +1397,10 @@
|
|||||||
this.$.relatedChanges.reload();
|
this.$.relatedChanges.reload();
|
||||||
},
|
},
|
||||||
|
|
||||||
_computeHeaderClass(change) {
|
_computeHeaderClass(editMode) {
|
||||||
return change.work_in_progress ? 'header wip' : 'header';
|
const classes = ['header'];
|
||||||
|
if (editMode) { classes.push('editMode'); }
|
||||||
|
return classes.join(' ');
|
||||||
},
|
},
|
||||||
|
|
||||||
_computeEditMode(patchRangeRecord, paramsRecord) {
|
_computeEditMode(patchRangeRecord, paramsRecord) {
|
||||||
|
@@ -1324,12 +1324,11 @@ limitations under the License.
|
|||||||
assert.isFalse(element._computeCanStartReview(false, change, account1));
|
assert.isFalse(element._computeCanStartReview(false, change, account1));
|
||||||
assert.isFalse(element._computeCanStartReview(true, change, account2));
|
assert.isFalse(element._computeCanStartReview(true, change, account2));
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
test('header class computation', () => {
|
test('header class computation', () => {
|
||||||
assert.equal(element._computeHeaderClass({}), 'header');
|
assert.equal(element._computeHeaderClass(), 'header');
|
||||||
assert.equal(element._computeHeaderClass({work_in_progress: true}),
|
assert.equal(element._computeHeaderClass(true), 'header editMode');
|
||||||
'header wip');
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('_maybeScrollToMessage', () => {
|
test('_maybeScrollToMessage', () => {
|
||||||
|
@@ -39,9 +39,6 @@ limitations under the License.
|
|||||||
.collapseToggleButton {
|
.collapseToggleButton {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
.patchInfoEdit.patchInfo-header {
|
|
||||||
background-color: #fcfad6;
|
|
||||||
}
|
|
||||||
.patchInfoOldPatchSet.patchInfo-header {
|
.patchInfoOldPatchSet.patchInfo-header {
|
||||||
background-color: #fff9c4;
|
background-color: #fff9c4;
|
||||||
}
|
}
|
||||||
@@ -138,7 +135,8 @@ limitations under the License.
|
|||||||
font-family: var(--font-family-bold);
|
font-family: var(--font-family-bold);
|
||||||
margin-right: 24px;
|
margin-right: 24px;
|
||||||
}
|
}
|
||||||
gr-commit-info {
|
gr-commit-info,
|
||||||
|
gr-edit-controls {
|
||||||
margin-right: -5px;
|
margin-right: -5px;
|
||||||
}
|
}
|
||||||
@media screen and (max-width: 50em) {
|
@media screen and (max-width: 50em) {
|
||||||
|
@@ -189,10 +189,6 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
_computePatchInfoClass(patchNum, allPatchSets) {
|
_computePatchInfoClass(patchNum, allPatchSets) {
|
||||||
if (this.patchNumEquals(patchNum, this.EDIT_NAME)) {
|
|
||||||
return 'patchInfoEdit';
|
|
||||||
}
|
|
||||||
|
|
||||||
const latestNum = this.computeLatestPatchNum(allPatchSets);
|
const latestNum = this.computeLatestPatchNum(allPatchSets);
|
||||||
if (this.patchNumEquals(patchNum, latestNum)) {
|
if (this.patchNumEquals(patchNum, latestNum)) {
|
||||||
return '';
|
return '';
|
||||||
|
@@ -36,8 +36,8 @@ limitations under the License.
|
|||||||
background-color: var(--view-background-color);
|
background-color: var(--view-background-color);
|
||||||
}
|
}
|
||||||
gr-fixed-panel {
|
gr-fixed-panel {
|
||||||
background-color: #fff;
|
background-color: #ebf5fb;
|
||||||
border-bottom: 1px #eee solid;
|
border-bottom: 1px #ddd solid;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
header,
|
header,
|
||||||
@@ -48,7 +48,7 @@ limitations under the License.
|
|||||||
padding: .75em var(--default-horizontal-margin);
|
padding: .75em var(--default-horizontal-margin);
|
||||||
}
|
}
|
||||||
header gr-editable-label {
|
header gr-editable-label {
|
||||||
font-size: 1.2rem;
|
font-size: var(--font-size-large);
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
--label-style: {
|
--label-style: {
|
||||||
text-overflow: initial;
|
text-overflow: initial;
|
||||||
@@ -67,6 +67,11 @@ limitations under the License.
|
|||||||
.textareaWrapper .editButtons {
|
.textareaWrapper .editButtons {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
.controlGroup {
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
font-size: var(--font-size-large);
|
||||||
|
}
|
||||||
.rightControls {
|
.rightControls {
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
@@ -82,12 +87,16 @@ limitations under the License.
|
|||||||
</style>
|
</style>
|
||||||
<gr-fixed-panel keep-on-scroll>
|
<gr-fixed-panel keep-on-scroll>
|
||||||
<header>
|
<header>
|
||||||
<gr-editable-label
|
<span class="controlGroup">
|
||||||
label-text="File path"
|
<span>Edit mode</span>
|
||||||
value="[[_path]]"
|
<span class="separator"></span>
|
||||||
placeholder="File path..."
|
<gr-editable-label
|
||||||
on-changed="_handlePathChanged"></gr-editable-label>
|
label-text="File path"
|
||||||
<span class="rightControls">
|
value="[[_path]]"
|
||||||
|
placeholder="File path..."
|
||||||
|
on-changed="_handlePathChanged"></gr-editable-label>
|
||||||
|
</span>
|
||||||
|
<span class="controlGroup rightControls">
|
||||||
<gr-button
|
<gr-button
|
||||||
id="close"
|
id="close"
|
||||||
link
|
link
|
||||||
|
Reference in New Issue
Block a user