Skip to content

Commit

Permalink
Merge pull request #168 from ssshooter/v2.0.1
Browse files Browse the repository at this point in the history
V2.0.1
  • Loading branch information
SSShooter authored May 3, 2023
2 parents 1e04141 + b41df58 commit 43a418b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mind-elixir",
"version": "2.0.0",
"version": "2.0.1",
"description": "Mind elixir is a free open source mind map core.",
"main": "dist/MindElixir.js",
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions src/interact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function collectData(instance) {
* @description Select a node and add solid border to it.
* @param {TargetElement} el - Target element return by E('...'), default value: currentTarget.
*/
export const selectNode: SelectNode = function (targetElement, isNewNode) {
export const selectNode: SelectNodeFunc = function (targetElement, isNewNode, e) {
if (!targetElement) return
console.time('selectNode')
if (typeof targetElement === 'string') {
Expand All @@ -36,7 +36,8 @@ export const selectNode: SelectNode = function (targetElement, isNewNode) {
if (isNewNode) {
this.bus.fire('selectNewNode', targetElement.nodeObj)
} else {
this.bus.fire('selectNode', targetElement.nodeObj)
// the variable e indicates that the action is triggered by a click
this.bus.fire('selectNode', targetElement.nodeObj, e)
}
console.timeEnd('selectNode')
}
Expand Down
2 changes: 1 addition & 1 deletion types/mind-elixir/function.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type LinkDiv = (this: MindElixirInstance, mainNode?: Wrapper) => void
type JudgeDirection = (this: MindElixirInstance, mainNode: Wrapper, obj: NodeObj) => void

type ExpandNode = (this: MindElixirInstance, el: Topic, isExpand: boolean) => void
type SelectNode = (this: MindElixirInstance, targetElement: Topic, isNewNode?: boolean) => void
type SelectNodeFunc = (this: MindElixirInstance, targetElement: Topic, isNewNode?: boolean, e?: MouseEvent) => void
type CommonSelectFunc = (this: MindElixirInstance) => void
type SiblingSelectFunc = (this: MindElixirInstance) => boolean

Expand Down
4 changes: 2 additions & 2 deletions types/mind-elixir/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface MindElixirInstance {
// wip
bus: {
addListener: (type: string, handler) => void
fire: (type: string, data?) => void
fire: (type: string, ...payload) => void
}

// wip
Expand Down Expand Up @@ -80,7 +80,7 @@ interface MindElixirInstance {
createInputDiv: CreateInputDiv
layoutChildren: LayoutChildren

selectNode: SelectNode
selectNode: SelectNodeFunc
unselectNode: CommonSelectFunc
selectNextSibling: SiblingSelectFunc
selectPrevSibling: SiblingSelectFunc
Expand Down

0 comments on commit 43a418b

Please sign in to comment.