Skip to content

Commit c41e10c

Browse files
committed
Merge branch 't/11478b'
2 parents 91779e8 + 734f9f1 commit c41e10c

File tree

5 files changed

+64
-0
lines changed

5 files changed

+64
-0
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CKEditor 4 Changelog
55

66
Fixed Issues:
77

8+
* [#11478](http://dev.ckeditor.com/ticket/11478): Fixed: Issue with passing jQuery objects to adapter configuration.
89
* [#10867](http://dev.ckeditor.com/ticket/10867): Fixed: Issue with setting encoded URI as image's link.
910
* [#10091](http://dev.ckeditor.com/ticket/10091): Blockquote should be treated like an object by the styles system. Thanks to [dan-james-deeson](https://github.com/dan-james-deeson)!
1011
* [#11983](http://dev.ckeditor.com/ticket/11983): Fixed: Clicking a nested widget does not focus it. Additionally, performance of the [`widget.repository.getByElement()`](http://docs.ckeditor.com/#!/api/CKEDITOR.plugins.widget.repository-method-getByElement) method has been improved.

core/tools.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@
109109
if ( obj === null || ( typeof( obj ) != 'object' ) || ( obj instanceof String ) || ( obj instanceof Number ) || ( obj instanceof Boolean ) || ( obj instanceof Date ) || ( obj instanceof RegExp ) )
110110
return obj;
111111

112+
// DOM objects and window.
113+
if ( obj.nodeType || obj.window === obj )
114+
return obj;
115+
112116
// Objects.
113117
clone = new obj.constructor();
114118

tests/core/tools.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,42 @@ bender.test(
141141
assert.areSame( 'John', obj.name );
142142
assert.areSame( 'Paul', clone.name );
143143

144+
assert.areNotSame( obj.cars, clone.cars );
144145
assert.areSame( 'red', obj.cars.Porsche.color );
145146
assert.areSame( 'silver', clone.cars.Porsche.color );
146147
},
147148

149+
test_clone_DOM: function() {
150+
var anchor = document.createElement( 'a' );
151+
var obj = {
152+
anchor: anchor
153+
};
154+
155+
var clone = CKEDITOR.tools.clone( obj );
156+
157+
assert.areSame( clone.anchor, anchor );
158+
},
159+
160+
test_clone_Window: function() {
161+
var obj = {
162+
window: window
163+
};
164+
165+
var clone = CKEDITOR.tools.clone( obj );
166+
167+
assert.areSame( clone.window, window );
168+
},
169+
170+
test_clone_Document: function() {
171+
var obj = {
172+
document: document
173+
};
174+
175+
var clone = CKEDITOR.tools.clone( obj );
176+
177+
assert.areSame( clone.document, document );
178+
},
179+
148180
test_repeat: function() {
149181
assert.areSame( '   ', CKEDITOR.tools.repeat( ' ', 3 ) );
150182
},

tests/tickets/11478/1.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<div id="container"></div>
2+
<textarea id="editable" cols="80" rows="10">editor1</textarea>

tests/tickets/11478/1.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* bender-tags: editor,unit */
2+
/* bender-ckeditor-adapters: jquery */
3+
/* bender-ckeditor-plugins: wysiwygarea */
4+
5+
( function() {
6+
'use strict';
7+
8+
bender.test( {
9+
'test pass jQuery object into config': function() {
10+
var configObj = {
11+
element: $( '#container' )
12+
};
13+
14+
$( '#editable' ).ckeditor( function() {
15+
var editor = this;
16+
17+
resume( function() {
18+
assert.areSame( configObj.element[ 0 ], editor.config.element[ 0 ], 'element was passed safely to editor.config' );
19+
} );
20+
}, configObj );
21+
22+
wait();
23+
}
24+
} );
25+
} )();

0 commit comments

Comments
 (0)