Работа над HistoryPage

This commit is contained in:
Book Pauk
2019-01-26 05:40:11 +07:00
parent 470ee63714
commit a2ebf0a71c
3 changed files with 27 additions and 6 deletions

View File

@@ -23,7 +23,7 @@
sortable sortable
> >
<template slot="header" slot-scope="scope"><!-- eslint-disable-line vue/no-unused-vars --> <template slot="header" slot-scope="scope"><!-- eslint-disable-line vue/no-unused-vars -->
Время<br>просм. <span style="font-size: 90%">Время<br>просм.</span>
</template> </template>
<template slot-scope="scope"><!-- eslint-disable-line vue/no-unused-vars --> <template slot-scope="scope"><!-- eslint-disable-line vue/no-unused-vars -->
<div class="desc" @click="loadBook(scope.row.url)"> <div class="desc" @click="loadBook(scope.row.url)">
@@ -69,7 +69,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@click="handleDel(scope.row.key)">X style="width: 30px; padding: 7px 0 7px 0; margin-left: 4px"
@click="handleDel(scope.row.key)"><i class="el-icon-close"></i>
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@@ -187,8 +188,8 @@ class HistoryPage extends Vue {
keyHook(event) { keyHook(event) {
if (event.type == 'keydown' && event.code == 'Escape') { if (event.type == 'keydown' && event.code == 'Escape') {
this.close(); this.close();
return true;
} }
return true;
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@@ -379,8 +379,15 @@ class Reader extends Vue {
if (this.$refs.page && this.$refs.page.keyHook) if (this.$refs.page && this.$refs.page.keyHook)
handled = this.$refs.page.keyHook(event); handled = this.$refs.page.keyHook(event);
if (!handled && event.type == 'keydown' && event.code == 'Escape') { if (!handled && event.type == 'keydown') {
this.loaderToggle(); switch (event.code) {
case 'Escape':
this.loaderToggle();
break;
case 'KeyH':
this.historyToggle();
break;
}
} }
} }
} }

View File

@@ -2,6 +2,7 @@
<div class="window"> <div class="window">
<div class="header"> <div class="header">
<span class="header-text"><slot name="header"></slot></span> <span class="header-text"><slot name="header"></slot></span>
<span class="close-button" @click="close"><i class="el-icon-close"></i></span>
</div> </div>
<slot></slot> <slot></slot>
</div> </div>
@@ -15,7 +16,8 @@ import Component from 'vue-class-component';
export default @Component({ export default @Component({
}) })
class Window extends Vue { class Window extends Vue {
created() { close() {
this.$emit('close');
} }
} }
@@ -35,12 +37,23 @@ class Window extends Vue {
.header { .header {
display: flex; display: flex;
justify-content: flex-end;
align-items: center; align-items: center;
height: 40px; height: 40px;
} }
.header-text { .header-text {
flex: 1;
margin-left: 10px; margin-left: 10px;
margin-right: 10px; margin-right: 10px;
} }
.close-button {
display: flex;
justify-content: center;
align-items: center;
width: 40px;
height: 40px;
cursor: pointer;
}
</style> </style>