Merge "Make it more clear when in "edit mode""

This commit is contained in:
Kasper Nilsson
2018-02-16 22:34:09 +00:00
committed by Gerrit Code Review
6 changed files with 32 additions and 25 deletions

View File

@@ -63,6 +63,9 @@ limitations under the License.
padding: .55em var(--default-horizontal-margin);
z-index: 99; /* Less than gr-overlay's backdrop */
}
.header.editMode {
background-color: #ebf5fb;
}
.header .download {
margin-right: 1em;
}
@@ -320,7 +323,7 @@ limitations under the License.
id="mainContent"
class="container"
hidden$="{{_loading}}">
<div class$="[[_computeHeaderClass(_change)]]">
<div class$="[[_computeHeaderClass(_editMode)]]">
<div class="headerTitle">
<gr-change-star
id="changeStar"

View File

@@ -1397,8 +1397,10 @@
this.$.relatedChanges.reload();
},
_computeHeaderClass(change) {
return change.work_in_progress ? 'header wip' : 'header';
_computeHeaderClass(editMode) {
const classes = ['header'];
if (editMode) { classes.push('editMode'); }
return classes.join(' ');
},
_computeEditMode(patchRangeRecord, paramsRecord) {

View File

@@ -1324,12 +1324,11 @@ limitations under the License.
assert.isFalse(element._computeCanStartReview(false, change, account1));
assert.isFalse(element._computeCanStartReview(true, change, account2));
});
});
test('header class computation', () => {
assert.equal(element._computeHeaderClass({}), 'header');
assert.equal(element._computeHeaderClass({work_in_progress: true}),
'header wip');
});
test('header class computation', () => {
assert.equal(element._computeHeaderClass(), 'header');
assert.equal(element._computeHeaderClass(true), 'header editMode');
});
test('_maybeScrollToMessage', () => {

View File

@@ -39,9 +39,6 @@ limitations under the License.
.collapseToggleButton {
text-decoration: none;
}
.patchInfoEdit.patchInfo-header {
background-color: #fcfad6;
}
.patchInfoOldPatchSet.patchInfo-header {
background-color: #fff9c4;
}
@@ -138,7 +135,8 @@ limitations under the License.
font-family: var(--font-family-bold);
margin-right: 24px;
}
gr-commit-info {
gr-commit-info,
gr-edit-controls {
margin-right: -5px;
}
@media screen and (max-width: 50em) {

View File

@@ -189,10 +189,6 @@
},
_computePatchInfoClass(patchNum, allPatchSets) {
if (this.patchNumEquals(patchNum, this.EDIT_NAME)) {
return 'patchInfoEdit';
}
const latestNum = this.computeLatestPatchNum(allPatchSets);
if (this.patchNumEquals(patchNum, latestNum)) {
return '';

View File

@@ -36,8 +36,8 @@ limitations under the License.
background-color: var(--view-background-color);
}
gr-fixed-panel {
background-color: #fff;
border-bottom: 1px #eee solid;
background-color: #ebf5fb;
border-bottom: 1px #ddd solid;
z-index: 1;
}
header,
@@ -48,7 +48,7 @@ limitations under the License.
padding: .75em var(--default-horizontal-margin);
}
header gr-editable-label {
font-size: 1.2rem;
font-size: var(--font-size-large);
font-weight: bold;
--label-style: {
text-overflow: initial;
@@ -67,6 +67,11 @@ limitations under the License.
.textareaWrapper .editButtons {
display: none;
}
.controlGroup {
align-items: center;
display: flex;
font-size: var(--font-size-large);
}
.rightControls {
justify-content: flex-end;
}
@@ -82,12 +87,16 @@ limitations under the License.
</style>
<gr-fixed-panel keep-on-scroll>
<header>
<gr-editable-label
label-text="File path"
value="[[_path]]"
placeholder="File path..."
on-changed="_handlePathChanged"></gr-editable-label>
<span class="rightControls">
<span class="controlGroup">
<span>Edit mode</span>
<span class="separator"></span>
<gr-editable-label
label-text="File path"
value="[[_path]]"
placeholder="File path..."
on-changed="_handlePathChanged"></gr-editable-label>
</span>
<span class="controlGroup rightControls">
<gr-button
id="close"
link