improve logic of success message

instead of taking over whole sidebar, it now just shows over the commit box
after 5 seconds the commit box goes back to its compact logic
This commit is contained in:
Phil Hughes 2018-05-04 12:52:46 +01:00
parent 255e8ea8fd
commit cb8682b841
No known key found for this signature in database
GPG key ID: 32245528C52E0F9F
5 changed files with 36 additions and 12 deletions

View file

@ -39,10 +39,17 @@ export default {
},
watch: {
currentActivityView() {
if (this.lastCommitMsg) {
this.isCompact = false;
} else {
this.isCompact = !(
this.currentActivityView === activityBarViews.commit &&
window.innerHeight >= MAX_WINDOW_HEIGHT_COMPACT
);
}
},
lastCommitMsg() {
this.isCompact = this.lastCommitMsg === '';
},
},
methods: {
@ -122,9 +129,11 @@ export default {
@submit.prevent.stop="commitChanges"
ref="formEl"
>
<transition name="fade">
<success-message
v-show="(lastCommitMsg && someUncommitedChanges)"
v-show="lastCommitMsg"
/>
</transition>
<commit-message-field
:text="commitMessage"
@input="updateCommitMessage"

View file

@ -53,6 +53,9 @@ export default {
<label
v-tooltip
:title="tooltipTitle"
:class="{
'is-disabled': disabled
}"
>
<input
type="radio"
@ -63,9 +66,12 @@ export default {
:disabled="disabled"
/>
<span class="prepend-left-10">
<template v-if="label">
<span
v-if="label"
class="ide-radio-label"
>
{{ label }}
</template>
</span>
<slot v-else></slot>
</span>
</label>

View file

@ -112,9 +112,6 @@ export default {
/>
</div>
<commit-form />
<success-message
v-show="showSuccessMessage"
/>
</template>
</div>
</resizable-panel>

View file

@ -173,6 +173,12 @@ export default {
state.entries[file.path].opened = false;
state.entries[file.path].active = false;
state.entries[file.path].lastOpenedAt = new Date().getTime();
state.openFiles.forEach(f =>
Object.assign(f, {
opened: false,
active: false,
}),
);
state.openFiles = [
{
...file,

View file

@ -797,6 +797,12 @@
.ide-commit-radios {
label {
font-weight: normal;
&.is-disabled {
.ide-radio-label {
text-decoration: line-through;
}
}
}
.help-block {