Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add button to toggle fullscreen uml viewer #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<div :class="[historyCol ? `col-sm-${historyCol}` : 'col-sm-2']" v-show="Boolean(historyCol)">
<historyList :height="height"></historyList>
</div>
<div class="col-editor" :class="[editorCol ? `col-sm-${editorCol}` : 'col-sm-4']">
<div class="col-editor" :class="[editorCol ? `col-sm-${editorCol}` : 'col-sm-4']" v-show="Boolean(editorCol)">
<editor :height="height"></editor>
</div>
<div :class="[cheatSheetCol ? `col-sm-${cheatSheetCol}` : 'col-sm-3']" v-show="Boolean(cheatSheetCol)">
<cheatSheet :height="height"></cheatSheet>
</div>
<div :class="[umlCol ? `col-sm-${umlCol}` : 'col-sm-6']">
<div :class="[umlCol ? `col-sm-${umlCol}` : 'col-sm-6']" v-show="Boolean(umlCol)">
<functionTop></functionTop>
<uml :height="umlH"></uml>
</div>
Expand Down
6 changes: 6 additions & 0 deletions src/components/Parameters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
<button type="button" class="btn btn-default" @click="showGistModal" :disabled="umlExtension!='svg'" data-toggle="tooltip" data-placement="bottom" title="share" data-container="body">
<span class="glyphicon glyphicon-share-alt"></span>
</button>
<button type="button" class="btn btn-default" @click.prevent="toggleFullsizeUml">
<span class="glyphicon glyphicon-fullscreen"></span>
</button>
</div>
</div>
</form>
Expand Down Expand Up @@ -110,6 +113,9 @@ export default {
},
print () {
printjs('umlArea', 'html')
},
toggleFullsizeUml () {
this.$store.dispatch('layout/toggleFullsizeUml')
}
}
}
Expand Down
18 changes: 18 additions & 0 deletions src/store/modules/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ const state: any = {
'editor': 4,
'cheatSheet': 0,
'uml': 6
},
fullSize: {
'uml': false,
previousColSize: null
}
}

Expand Down Expand Up @@ -59,6 +63,20 @@ const actions: any = {
'cheatSheet': 0,
'uml': 6
})
},
toggleFullsizeUml (context: any) {
if (context.state.fullSize.uml) {
context.dispatch('setColSize', context.state.fullSize.previousColSize)
} else {
context.state.fullSize.previousColSize = JSON.parse(JSON.stringify(context.state.colSize))
context.commit('setColSize', {
'history': 0,
'editor': 0,
'cheatSheet': 0,
'uml': 12
})
}
context.state.fullSize.uml = !context.state.fullSize.uml
}
}

Expand Down