File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 11import type { MindElixirInstance , Topic } from '.'
22import { generateUUID , getOffsetLT , setAttributes } from './utils'
3- import { findEle , selectText } from './utils/dom'
3+ import { findEle } from './utils/dom'
44import { editSvgText } from './utils/svg'
55
66export type Summary = {
Original file line number Diff line number Diff line change @@ -6,11 +6,11 @@ import { layoutChildren } from './layout'
66
77// DOM manipulation
88const $d = document
9- export const findEle = ( id : string , instance ?: MindElixirInstance ) : Topic => {
9+ export const findEle = ( id : string , instance ?: MindElixirInstance ) => {
1010 const scope = instance ? instance . mindElixirBox : $d
1111 const ele = scope . querySelector < Topic > ( `[data-nodeid=me${ id } ]` )
12- if ( ! ele ) new Error ( `findEle: ${ id } not found` )
13- return ele as Topic
12+ if ( ! ele ) throw new Error ( `findEle: ${ id } not found` )
13+ return ele
1414}
1515
1616export const shapeTpc = function ( tpc : Topic , nodeObj : NodeObj ) {
You can’t perform that action at this time.
0 commit comments