Skip to content

Commit

Permalink
文档查看页面增加快捷键 Ctrl/CMD + S 打开导出窗口
Browse files Browse the repository at this point in the history
  • Loading branch information
mylxsw committed Sep 3, 2019
1 parent e0196cb commit 0510ed1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<li role="presentation" class="mr-2">
<button type="button" data-toggle="modal" data-target="#wz-export" title="导出全部文档"
class="btn btn-primary bmd-btn-icon">
class="btn btn-primary bmd-btn-icon" id="wz-export-trigger">
<span class="fa fa-download"></span>
</button>
</li>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/page-menus-export.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<li role="presentation" class="mr-2">
<button type="button" data-toggle="modal" data-target="#wz-export" title="导出文件" class="btn btn-primary bmd-btn-icon">
<button type="button" data-toggle="modal" data-target="#wz-export" title="导出文件" class="btn btn-primary bmd-btn-icon" id="wz-export-trigger">
<span class="fa fa-download"></span>
</button>
</li>
Expand Down
11 changes: 11 additions & 0 deletions resources/views/project/project.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,17 @@
});
}
}, null, 'html');
// 快捷键导出
var exportBtn = $('#wz-export-trigger');
document.addEventListener('keydown', function (e) {
if (e.key === "s" && (e.ctrlKey||e.metaKey)) {
e.preventDefault();
if (exportBtn) {
exportBtn.trigger('click');
}
}
});
});
</script>
@endif
Expand Down

0 comments on commit 0510ed1

Please sign in to comment.