Skip to content

Commit

Permalink
fix #276, fix #275
Browse files Browse the repository at this point in the history
  • Loading branch information
hinesboy committed Jul 3, 2018
1 parent 02d7bf7 commit 03cbf75
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
3 changes: 3 additions & 0 deletions LOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# 更新日志
- **2.6.12** 修复issues(18.7.3)
- [issue #276](https://github.com/hinesboy/mavonEditor/pull/276)
- [issue #275](https://github.com/hinesboy/mavonEditor/pull/275)
- **2.6.11** [pr #274](https://github.com/hinesboy/mavonEditor/pull/274)(18.7.1)
- **2.6.9** 增加toc插件(18.6.15)
- **2.6.7** 处理粗体+斜体不生效问题(18.6.15)
Expand Down
2 changes: 1 addition & 1 deletion dist/mavon-editor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mavon-editor",
"version": "2.6.11",
"version": "2.6.12",
"description": "Vue markdown editor",
"main": "dist/mavon-editor.js",
"scripts": {
Expand Down
17 changes: 11 additions & 6 deletions src/components/md-toolbar-left.vue
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@
$imgDelByFilename(filename) {
var pos = 0;
while (this.img_file.length > pos) {
console.log('=============')
console.log(this.img_file[pos])
if (this.img_file[pos][0] == filename || this.isEqualName(filename, pos)) {
this.$imgDel(pos);
Expand Down Expand Up @@ -264,8 +263,10 @@
},
// 工具栏功能图标click-----------------
$mouseenter_img_dropdown() {
clearTimeout(this.img_timer)
this.s_img_dropdown_open = true
if (this.editable) {
clearTimeout(this.img_timer)
this.s_img_dropdown_open = true
}
},
$mouseleave_img_dropdown() {
let vm = this
Expand All @@ -274,8 +275,10 @@
},200)
},
$mouseenter_header_dropdown() {
clearTimeout(this.header_timer)
this.s_header_dropdown_open = true
if (this.editable) {
clearTimeout(this.header_timer)
this.s_header_dropdown_open = true
}
},
$mouseleave_header_dropdown() {
let vm = this
Expand All @@ -285,7 +288,9 @@
},
$clicks(_type) {
// 让父节点来绑定事件并
this.$emit('toolbar_left_click', _type);
if (this.editable) {
this.$emit('toolbar_left_click', _type);
}
},
$click_header(_type) {
// 让父节点来绑定事件并
Expand Down
3 changes: 3 additions & 0 deletions src/lib/toolbar_left_click.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,19 @@ function $toolbar_left_undo_click($vm) {
$vm.getTextareaDom().selectionEnd = start
})
}
$vm.getTextareaDom().focus()
}
// redo
function $toolbar_left_redo_click($vm) {
if ($vm.d_history_index < $vm.d_history.length - 1) {
$vm.d_history_index++
}
$vm.getTextareaDom().focus()
// $vm.$refs.vNoteDivEdit.innerHTML = $vm.s_markdown.render($vm.d_value)
}
function $toolbar_left_trash_click($vm) {
$vm.d_value = ''
$vm.getTextareaDom().focus()
// $vm.$refs.vNoteDivEdit.innerHTML = $vm.s_markdown.render($vm.d_value)
}
function $toolbar_left_save_click($vm) {
Expand Down
2 changes: 2 additions & 0 deletions src/mavon-editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@
keydownListen(this);
// 图片预览事件监听
ImagePreviewListener(this);
// 设置默认焦点
this.getTextareaDom().focus();
// fullscreen事件
fullscreenchange(this);
this.d_value = this.value;
Expand Down

0 comments on commit 03cbf75

Please sign in to comment.