File tree Expand file tree Collapse file tree 8 files changed +21
-21
lines changed Expand file tree Collapse file tree 8 files changed +21
-21
lines changed Original file line number Diff line number Diff line change 9999 pointer-events : all ;
100100 max-width : 800px ;
101101 white-space : pre-wrap ;
102- line-height : 1 ; // 保证中英文行高一致
102+ line-height : 1 ; // assure the line-height consistency between different languages
103103 #input-box {
104104 padding : 5px ;
105105 }
Original file line number Diff line number Diff line change @@ -70,16 +70,22 @@ import mobileMenu from './plugin/mobileMenu'
7070import Bus from './utils/pubsub'
7171
7272import './index.less'
73- import './plugin/contextMenu.less'
74- import './plugin/toolBar.less'
75- import './plugin/nodeMenu.less'
76- import './plugin/mobileMenu.less'
7773
7874// import { exportSvg, exportPng } from '../painter'
7975
8076import './iconfont/iconfont.js'
8177
8278// TODO show up animation
79+
80+ /**
81+ * @function
82+ * @global
83+ * @name E
84+ * @param {string } id Node id.
85+ * @return {TargetElement } Target element.
86+ * @example
87+ * E('bd4313fbac40284b')
88+ */
8389export const E = findEle
8490type LinkObj = object
8591type operation = {
@@ -346,15 +352,6 @@ MindElixir.prototype = {
346352 refresh,
347353
348354 init : function ( ) {
349- /**
350- * @function
351- * @global
352- * @name E
353- * @param {string } id Node id.
354- * @return {TargetElement } Target element.
355- * @example
356- * E('bd4313fbac40284b')
357- */
358355 addParentLink ( this . nodeData )
359356 console . log ( 'ME_version ' + MindElixir . version )
360357 console . log ( this )
Original file line number Diff line number Diff line change 11import i18n from '../i18n'
22import { encodeHTML } from '../utils/index'
3+ import './contextMenu.less'
34
45export default function ( mind , option ) {
56 const createTips = words => {
@@ -163,7 +164,7 @@ export default function(mind, option) {
163164 ) {
164165 mind . createLink ( from , mind . currentNode )
165166 } else {
166- console . log ( '取消连接 ' )
167+ console . log ( 'link cancel ' )
167168 }
168169 } ,
169170 {
Original file line number Diff line number Diff line change 1+ import './mobileMenu.less'
2+
13export default function ( mind , option ?) {
24 const createLi = ( id , name ) => {
35 const div = document . createElement ( 'div' )
Original file line number Diff line number Diff line change 1+ import './nodeMenu.less'
12import i18n from '../i18n'
23
34const createDiv = ( id ) => {
Original file line number Diff line number Diff line change 1+ import './toolBar.less'
2+
13const createButton = ( id , name ) => {
24 const button = document . createElement ( 'span' )
35 button . id = id
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ export function createInputDiv(tpc: Topic) {
128128 div . addEventListener ( 'keydown' , e => {
129129 e . stopPropagation ( )
130130 const key = e . key
131- // console.log(e, key)
131+
132132 if ( key === 'Enter' || key === 'Tab' ) {
133133 // keep wrap for shift enter
134134 if ( e . shiftKey ) return
@@ -139,15 +139,15 @@ export function createInputDiv(tpc: Topic) {
139139 }
140140 } )
141141 div . addEventListener ( 'blur' , ( ) => {
142- if ( ! div ) return // 防止重复blur
142+ if ( ! div ) return
143143 const node = tpc . nodeObj
144144 const topic = div . textContent ! . trim ( )
145145 console . log ( topic )
146146 if ( topic === '' ) node . topic = origin
147147 else node . topic = topic
148148 div . remove ( )
149149 this . inputDiv = div = null
150- if ( topic === origin ) return // 没有修改不做处理
150+ if ( topic === origin ) return
151151 tpc . childNodes [ 0 ] . textContent = node . topic
152152 this . linkDiv ( )
153153 this . bus . fire ( 'operation' , {
@@ -162,7 +162,6 @@ export function createInputDiv(tpc: Topic) {
162162export const createExpander = function ( expanded : boolean | undefined ) : Expander {
163163 const expander : Expander = $d . createElement ( 'epd' )
164164 // 包含未定义 expanded 的情况,未定义视为展开
165- // expander.innerText = expanded !== false ? '⊖' : '⊕'
166165 expander . expanded = expanded !== false
167166 expander . className = expanded !== false ? 'minus' : ''
168167 return expander
Original file line number Diff line number Diff line change @@ -39,8 +39,6 @@ export const createPath = function(d: string) {
3939 path . setAttribute ( 'fill' , 'none' )
4040 path . setAttribute ( 'stroke-linecap' , 'square' )
4141 path . setAttribute ( 'stroke-width' , '1' )
42- path . setAttribute ( 'transform' , 'translate(0.5,-0.5)' )
43- // adding translate(0.5,-0.5) can fix render error on windows, but i still dunno why
4442 return path
4543}
4644
You can’t perform that action at this time.
0 commit comments