Commit 1cf019b7 authored by campaign's avatar campaign

by zhanyi

parent 532153c8
...@@ -2,8 +2,10 @@ ...@@ -2,8 +2,10 @@
<html> <html>
<head> <head>
<script src="jquery-2.1.0.min.js"></script>
<script src="kity.all.js"></script> <script src="kity.all.js"></script>
<script src="../dist/dev.php"></script> <script src="../dist/dev.php"></script>
<link href="import.css" />
<style> <style>
.km_receiver{ .km_receiver{
width:300px;height:300px; width:300px;height:300px;
...@@ -27,6 +29,10 @@ ...@@ -27,6 +29,10 @@
var val = e.target.value; var val = e.target.value;
minder.execCommand("switchlayout",val); minder.execCommand("switchlayout",val);
},false); },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)]); // 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")); // minder.getRenderContainer().addShape(b.stroke("white"));
</script> </script>
......
...@@ -55,7 +55,7 @@ kity.extendClass( Minder, { ...@@ -55,7 +55,7 @@ kity.extendClass( Minder, {
callbacks.push( callback ); callbacks.push( callback );
}, },
_fire: function ( e ) { _fire: function ( e ) {
var callbacks = this._eventCallbacks[ e.type ]; var callbacks = this._eventCallbacks[ e.type.toLowerCase() ];
if ( !callbacks ) { if ( !callbacks ) {
return false; return false;
} }
...@@ -70,7 +70,7 @@ kity.extendClass( Minder, { ...@@ -70,7 +70,7 @@ kity.extendClass( Minder, {
on: function ( name, callback ) { on: function ( name, callback ) {
var types = name.split( ' ' ); var types = name.split( ' ' );
for ( var i = 0; i < types.length; i++ ) { for ( var i = 0; i < types.length; i++ ) {
this._listen( types[ i ], callback ); this._listen( types[ i ].toLowerCase(), callback );
} }
return this; return this;
}, },
...@@ -78,7 +78,7 @@ kity.extendClass( Minder, { ...@@ -78,7 +78,7 @@ kity.extendClass( Minder, {
var types = name.split( ' ' ); var types = name.split( ' ' );
var i, j, callbacks, removeIndex; var i, j, callbacks, removeIndex;
for ( i = 0; i < types.length; i++ ) { for ( i = 0; i < types.length; i++ ) {
callbacks = this._eventCallbacks[ types[ i ] ]; callbacks = this._eventCallbacks[ types[ i ].toLowerCase() ];
if ( callbacks ) { if ( callbacks ) {
removeIndex = null; removeIndex = null;
for ( j = 0; j < callbacks.length; j++ ) { for ( j = 0; j < callbacks.length; j++ ) {
......
...@@ -29,13 +29,13 @@ KityMinder.registerModule( "fontmodule", function () { ...@@ -29,13 +29,13 @@ KityMinder.registerModule( "fontmodule", function () {
}, },
"events": { "events": {
"beforerendernode": function ( e ) { "beforeRenderNode": function ( e ) {
var val; var val;
if(val = e.node.getData('fontfamily')){ if(val = e.node.getData('fontfamily')){
e.node.getTextShape().setAttr('font-family',val); e.node.getTextShape().setAttr('font-family',val);
} }
if(val = e.node.getData('fontcolor')){ 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