Commit 95d27ab5 authored by campaign's avatar campaign

by zhanyi

parent dc2ad4be
var KityMinder = window.KM = window.KityMinder = {};
var KityMinder =
window.KM =
window.KityMinder = function(){
var instanceMap = {}, instanceId = 0;
return {
version : '1.0.0',
createMinder : function ( renderTarget, options ) {
options = options || {};
options.renderTo = Utils.isString( renderTarget ) ? document.getElementById( renderTarget ) : renderTarget;
var minder = new Minder( options );
this.addMinder(options.renderTo,minder);
return minder;
},
addMinder : function ( target, minder ) {
var id;
if ( typeof ( target ) === 'string' ) {
id = target;
} else {
id = target.id || ( "KM_INSTANCE_" + instanceId++ );
}
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.version = '1.0.0.0';
KityMinder.createMinder = function ( renderTarget, options ) {
options = options || {};
options.renderTo = Utils.isString( renderTarget ) ? document.getElementById( renderTarget ) : renderTarget;
return new Minder( options );
};
var instanceMap = {}, instanceId = 0;
KityMinder.addMinderInstance = function ( target, minder ) {
var id;
if ( typeof ( target ) === 'string' ) {
id = target;
} else {
id = target.id || ( "KM_INSTANCE_" + instanceId++ );
}
instanceMap[ id ] = minder;
};
KityMinder.getMinder = function ( id ) {
return instanceMap[ id ] || this.createMinder( id );
};
\ No newline at end of file
......@@ -47,7 +47,6 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
renderTo: function ( target ) {
this._paper.renderTo( this._renderTarget = target );
this._bindEvents();
KityMinder.addMinderInstance( target, this );
},
getRenderContainer: function () {
......
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