Ticket #2927: 2927_2.patch
File 2927_2.patch, 3.6 KB (added by , 15 years ago) |
---|
-
_source/plugins/dialog/plugin.js
999 999 1000 1000 // "Inherit" (copy actually) from CKEDITOR.event. 1001 1001 CKEDITOR.event.implementOn( CKEDITOR.dialog ); 1002 CKEDITOR.event.implementOn( CKEDITOR.dialog.prototype );1002 CKEDITOR.event.implementOn( CKEDITOR.dialog.prototype, true ); 1003 1003 1004 1004 var defaultDialogDefinition = 1005 1005 { -
_source/core/editor_basic.js
174 174 }; 175 175 176 176 // "Inherit" (copy actually) from CKEDITOR.event. 177 CKEDITOR.event.implementOn( CKEDITOR.editor.prototype );177 CKEDITOR.event.implementOn( CKEDITOR.editor.prototype, true ); 178 178 } -
_source/core/event.js
18 18 */ 19 19 CKEDITOR.event = function() 20 20 { 21 ( this._ || ( this._ = {} ) ).events = {}; 21 //In case of preserving existed events 22 var preExistedEvents = this._ && this._.events; 23 if( !preExistedEvents ) 24 ( this._ || ( this._ = {} ) ).events = {}; 22 25 }; 23 26 24 27 /** … … 24 27 /** 25 28 * Implements the {@link CKEDITOR.event} features in an object. 26 29 * @param {Object} targetObject The object in which implement the features. 30 * @param {Boolean} isTargetPrototype If the target is a prototype of 31 * constructor, the internal 'events' object will not be copied, 32 * which should be composed by the constructor itself. 27 33 * @example 28 34 * var myObject = { message : 'Example' }; 29 35 * <b>CKEDITOR.event.implementOn( myObject }</b>; … … 33 39 * }); 34 40 * myObject.fire( 'testEvent' ); 35 41 */ 36 CKEDITOR.event.implementOn = function( targetObject )42 CKEDITOR.event.implementOn = function( targetObject , isTargetPrototype) 37 43 { 38 CKEDITOR.event.call( targetObject ); 44 if( !isTargetPrototype ) 45 CKEDITOR.event.call( targetObject ); 39 46 40 47 for ( var prop in CKEDITOR.event.prototype ) 41 48 { 42 if ( targetObject[ prop ] == undefined ) 43 targetObject[ prop ] = CKEDITOR.event.prototype[ prop ]; 49 (function(){ 50 51 var property = prop; 52 53 if ( targetObject[ property ] == undefined ) 54 targetObject[ property ] = isTargetPrototype? 55 function() 56 { 57 //pre-setup events model 58 if( ! ( this._ && this._.events ) ) 59 CKEDITOR.event.call( this ); 60 61 ( this[ property ] = CKEDITOR.event.prototype[ property ] ) 62 .apply( this, arguments ); 63 } : 64 CKEDITOR.event.prototype[ property ]; 65 })(); 44 66 } 45 67 }; 46 68 -
_source/core/command.js
48 48 } 49 49 } 50 50 51 CKEDITOR.event.implementOn( CKEDITOR.command.prototype );51 CKEDITOR.event.implementOn( CKEDITOR.command.prototype, true ); -
_source/core/dom/domobject.js
192 191 }; 193 192 194 193 // Implement CKEDITOR.event. 195 CKEDITOR.event.implementOn( domObjectProto );194 CKEDITOR.event.implementOn( domObjectProto, true ); 196 195 197 196 })( CKEDITOR.dom.domObject.prototype );