Commit e64b93cc authored by Phil Hughes's avatar Phil Hughes

change button style when there are changes

parent 60c9c24e
......@@ -6,6 +6,10 @@
Icon,
},
props: {
hasChanges: {
type: Boolean,
required: true,
},
viewer: {
type: String,
required: true,
......@@ -33,6 +37,9 @@
<button
type="button"
class="btn btn-primary btn-sm"
:class="{
'btn-inverted': hasChanges,
}"
data-toggle="dropdown"
>
<template v-if="viewer === 'editor'">
......
<script>
import { mapActions, mapState } from 'vuex';
import { mapActions, mapGetters, mapState } from 'vuex';
import RepoTab from './repo_tab.vue';
import EditorMode from './editor_mode_dropdown.vue';
......@@ -14,6 +14,9 @@
};
},
computed: {
...mapGetters([
'hasChanges',
]),
...mapState([
'openFiles',
'viewer',
......@@ -47,6 +50,7 @@
<editor-mode
:viewer="viewer"
:show-shadow="showShadow"
:has-changes="hasChanges"
@click="updateViewer"
/>
</div>
......
......@@ -15,3 +15,5 @@ export const canEditFile = (state) => {
export const addedFiles = state => state.changedFiles.filter(f => f.tempFile);
export const modifiedFiles = state => state.changedFiles.filter(f => !f.tempFile);
export const hasChanges = state => !!state.changedFiles.length;
......@@ -82,7 +82,7 @@ describe('Multi-file editor library', () => {
});
});
fdescribe('attachModel', () => {
describe('attachModel', () => {
let model;
beforeEach(() => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment