Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kityminder-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
吴志俊
kityminder-core
Commits
95d27ab5
Commit
95d27ab5
authored
Feb 06, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
by zhanyi
parent
dc2ad4be
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
24 deletions
+33
-24
kityminder.js
src/core/kityminder.js
+33
-23
minder.js
src/core/minder.js
+0
-1
No files found.
src/core/kityminder.js
View file @
95d27ab5
var
KityMinder
=
window
.
KM
=
window
.
KityMinder
=
{};
var
KityMinder
=
window
.
KM
=
KityMinder
.
version
=
'1.0.0.0'
;
window
.
KityMinder
=
function
(){
var
instanceMap
=
{},
instanceId
=
0
;
KityMinder
.
createMinder
=
function
(
renderTarget
,
options
)
{
return
{
version
:
'1.0.0'
,
createMinder
:
function
(
renderTarget
,
options
)
{
options
=
options
||
{};
options
=
options
||
{};
options
.
renderTo
=
Utils
.
isString
(
renderTarget
)
?
document
.
getElementById
(
renderTarget
)
:
renderTarget
;
options
.
renderTo
=
Utils
.
isString
(
renderTarget
)
?
document
.
getElementById
(
renderTarget
)
:
renderTarget
;
return
new
Minder
(
options
);
var
minder
=
new
Minder
(
options
);
}
;
this
.
addMinder
(
options
.
renderTo
,
minder
)
;
return
minder
;
var
instanceMap
=
{},
instanceId
=
0
;
},
KityMinder
.
addMinderInstance
=
function
(
target
,
minder
)
{
addMinder
:
function
(
target
,
minder
)
{
var
id
;
var
id
;
if
(
typeof
(
target
)
===
'string'
)
{
if
(
typeof
(
target
)
===
'string'
)
{
id
=
target
;
id
=
target
;
...
@@ -17,8 +19,16 @@ KityMinder.addMinderInstance = function ( target, minder ) {
...
@@ -17,8 +19,16 @@ KityMinder.addMinderInstance = function ( target, minder ) {
id
=
target
.
id
||
(
"KM_INSTANCE_"
+
instanceId
++
);
id
=
target
.
id
||
(
"KM_INSTANCE_"
+
instanceId
++
);
}
}
instanceMap
[
id
]
=
minder
;
instanceMap
[
id
]
=
minder
;
};
},
getMinder
:
function
(
target
,
options
){
var
id
;
if
(
typeof
(
target
)
===
'string'
)
{
id
=
target
;
}
else
{
id
=
target
.
id
||
(
"KM_INSTANCE_"
+
instanceId
++
);
}
return
instanceMap
[
id
]
||
this
.
createMinder
(
target
,
options
);
}
}
}();
KityMinder
.
getMinder
=
function
(
id
)
{
return
instanceMap
[
id
]
||
this
.
createMinder
(
id
);
};
\ No newline at end of file
src/core/minder.js
View file @
95d27ab5
...
@@ -47,7 +47,6 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
...
@@ -47,7 +47,6 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
renderTo
:
function
(
target
)
{
renderTo
:
function
(
target
)
{
this
.
_paper
.
renderTo
(
this
.
_renderTarget
=
target
);
this
.
_paper
.
renderTo
(
this
.
_renderTarget
=
target
);
this
.
_bindEvents
();
this
.
_bindEvents
();
KityMinder
.
addMinderInstance
(
target
,
this
);
},
},
getRenderContainer
:
function
()
{
getRenderContainer
:
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment