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
87a53298
Commit
87a53298
authored
Dec 19, 2013
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added closure
parent
94a01e2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
kityminder.js
src/core/kityminder.js
+7
-6
No files found.
src/core/kityminder.js
View file @
87a53298
...
@@ -20,9 +20,10 @@ var KityMinder = km.KityMinder = kity.createClass("KityMinder", {
...
@@ -20,9 +20,10 @@ var KityMinder = km.KityMinder = kity.createClass("KityMinder", {
//模块注册&暴露模块接口
//模块注册&暴露模块接口
(
function
(){
(
function
(){
var
_modules
=
{}
;
var
_modules
;
KityMinder
.
registerModule
=
function
(
name
,
module
)
{
KityMinder
.
registerModule
=
function
(
name
,
module
)
{
//初始化模块列表
//初始化模块列表
if
(
!
_modules
){
_modules
=
{};}
_modules
[
name
]
=
module
;
_modules
[
name
]
=
module
;
};
};
KityMinder
.
getModules
=
function
(){
KityMinder
.
getModules
=
function
(){
...
@@ -34,7 +35,6 @@ var KityMinder = km.KityMinder = kity.createClass("KityMinder", {
...
@@ -34,7 +35,6 @@ var KityMinder = km.KityMinder = kity.createClass("KityMinder", {
kity
.
extendClass
(
KityMinder
,
(
function
(){
kity
.
extendClass
(
KityMinder
,
(
function
(){
var
_commands
=
{};
//command池子
var
_commands
=
{};
//command池子
var
_query
=
{};
//query池子
var
_query
=
{};
//query池子
return
{
return
{
_initModules
:
function
()
{
_initModules
:
function
()
{
var
_modules
=
KityMinder
.
getModules
();
var
_modules
=
KityMinder
.
getModules
();
...
@@ -74,15 +74,16 @@ kity.extendClass(KityMinder, (function(){
...
@@ -74,15 +74,16 @@ kity.extendClass(KityMinder, (function(){
}
}
},
},
execCommand
:
function
(
name
)
{
execCommand
:
function
(
name
)
{
var
me
=
this
;
var
_action
=
new
_commands
[
name
]();
var
_action
=
new
_commands
[
name
]();
console
.
log
(
_action
);
console
.
log
(
_action
);
var
args
=
arguments
;
var
args
=
arguments
;
args
[
0
]
=
this
;
args
[
0
]
=
this
;
if
(
_action
.
execute
){
if
(
_action
.
execute
){
_action
.
fire
(
"beforecommand"
);
me
.
fire
(
"beforecommand"
,
_action
);
_action
.
on
(
"precommand"
,
function
(
e
){
me
.
on
(
"precommand"
,
function
(
e
){
_action
.
execute
.
apply
(
null
,
args
);
if
(
e
.
target
===
_action
){
_action
.
execute
.
apply
(
null
,
args
);}
_action
.
fire
(
"command"
);
me
.
fire
(
"command"
,
_action
);
});
});
}
}
},
},
...
...
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