Skip to content

Commit 6291ffb

Browse files
author
yinquan
committed
add the autoHideContextMenu property
1 parent f59da72 commit 6291ffb

File tree

10 files changed

+24
-9
lines changed

10 files changed

+24
-9
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
2.14.0
2+
- added:
3+
- the autoHideContextMenu property
4+
15
2.13.0
2-
- same as 2.12.0
6+
- it's the same as 2.12.0. just publish it again for some reasons.
37

48
2.12.0
59
- added:

CHANGELOG.zh.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2.14.0
2+
- 添加:
3+
- 属性 autoHideContextMenu
4+
15
2.13.0
26
- 与2.12.0相同,只是重新发布
37

docs/css/app.ebdb39ed.css renamed to docs/css/app.bc7d151f.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>twtree</title><link href="css/app.ebdb39ed.css" rel="preload" as="style"><link href="js/app.e7408273.js" rel="preload" as="script"><link href="js/chunk-vendors.875f16f0.js" rel="preload" as="script"><link href="css/app.ebdb39ed.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but twtree doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.875f16f0.js"></script><script src="js/app.e7408273.js"></script></body></html>
1+
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>twtree</title><link href="css/app.bc7d151f.css" rel="preload" as="style"><link href="js/app.ac5dc377.js" rel="preload" as="script"><link href="js/chunk-vendors.875f16f0.js" rel="preload" as="script"><link href="css/app.bc7d151f.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but twtree doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.875f16f0.js"></script><script src="js/app.ac5dc377.js"></script></body></html>

docs/js/app.ac5dc377.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/js/app.ac5dc377.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/js/app.e7408273.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

docs/js/app.e7408273.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "twtree",
3-
"version": "2.13.0",
3+
"version": "2.14.0",
44
"description": "A highly customizable tree component for vue, which features checkbox, async loading, drag and drop, context menu and custom appearance.",
55
"main": "lib/twtree.umd.min.js",
66
"module": "lib/twtree.esm.js",

src/TWTree.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ export default {
188188
type: Boolean,
189189
default: true
190190
},
191+
autoHideContextMenu: {
192+
type: Boolean,
193+
default: true
194+
},
191195
fnLoadData: {
192196
type: Function,
193197
required: false,
@@ -702,7 +706,10 @@ export default {
702706
}
703707
this.select(node)
704708
}
705-
this.hideContextMenuOnDisplay()
709+
710+
if (this.autoHideContextMenu === true) {
711+
this.hideContextMenuOnDisplay()
712+
}
706713
},
707714
contextMenuEvent(node, event) {
708715
if (typeof(this.fnBeforeContextMenu) === 'function' && this.fnBeforeContextMenu(node, event) === false) {
@@ -736,7 +743,7 @@ export default {
736743
},
737744
treeBlurEvent(e) {
738745
let relatedTarget = e.relatedTarget
739-
if (this.contextMenu.node !== null && !this.getElement(this.contextMenu.node).contains(relatedTarget)) {
746+
if (this.contextMenu.node !== null && this.autoHideContextMenu === true && !this.getElement(this.contextMenu.node).contains(relatedTarget)) {
740747
this.hideContextMenuOnDisplay()
741748
}
742749
},

0 commit comments

Comments
 (0)