Commit 1cf019b7 authored by campaign's avatar campaign

by zhanyi

parent 532153c8
......@@ -2,8 +2,10 @@
<html>
<head>
<script src="jquery-2.1.0.min.js"></script>
<script src="kity.all.js"></script>
<script src="../dist/dev.php"></script>
<link href="import.css" />
<style>
.km_receiver{
width:300px;height:300px;
......@@ -27,6 +29,10 @@
var val = e.target.value;
minder.execCommand("switchlayout",val);
},false);
minder.select(minder.getRoot());
var node = new KM.MinderNode('test');
node.setData('fontcolor','red');
minder.execCommand('appendChildNode',node);
// var b = new kity.Bezier([new kity.BezierPoint(0,0).setVertex(100,100),new kity.BezierPoint(100,0).setVertex(100,100)]);
// minder.getRenderContainer().addShape(b.stroke("white"));
</script>
......
......@@ -55,7 +55,7 @@ kity.extendClass( Minder, {
callbacks.push( callback );
},
_fire: function ( e ) {
var callbacks = this._eventCallbacks[ e.type ];
var callbacks = this._eventCallbacks[ e.type.toLowerCase() ];
if ( !callbacks ) {
return false;
}
......@@ -70,7 +70,7 @@ kity.extendClass( Minder, {
on: function ( name, callback ) {
var types = name.split( ' ' );
for ( var i = 0; i < types.length; i++ ) {
this._listen( types[ i ], callback );
this._listen( types[ i ].toLowerCase(), callback );
}
return this;
},
......@@ -78,7 +78,7 @@ kity.extendClass( Minder, {
var types = name.split( ' ' );
var i, j, callbacks, removeIndex;
for ( i = 0; i < types.length; i++ ) {
callbacks = this._eventCallbacks[ types[ i ] ];
callbacks = this._eventCallbacks[ types[ i ].toLowerCase() ];
if ( callbacks ) {
removeIndex = null;
for ( j = 0; j < callbacks.length; j++ ) {
......
......@@ -29,13 +29,13 @@ KityMinder.registerModule( "fontmodule", function () {
},
"events": {
"beforerendernode": function ( e ) {
"beforeRenderNode": function ( e ) {
var val;
if(val = e.node.getData('fontfamily')){
e.node.getTextShape().setAttr('font-family',val);
}
if(val = e.node.getData('fontcolor')){
e.node.getTextShape().fill(color);
e.node.getTextShape().fill(val);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment