-
Notifications
You must be signed in to change notification settings - Fork 2.5k
/
themedui.js
37 lines (30 loc) · 1.47 KB
/
themedui.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* bender-ckeditor-plugins: wysiwygarea,toolbar,table */
( function() {
'use strict';
function getEditorContentHeight( editor ) {
return editor.ui.space( 'contents' ).$.offsetHeight;
}
function getEditorOuterHeight( editor ) {
return editor.container.$.offsetHeight;
}
bender.editor = true;
bender.test( {
'test resize event': function() {
var editor = this.editor,
lastResizeData = 0;
editor.on( 'resize', function(e) {
lastResizeData = e.data;
} );
editor.resize( 100, 400 );
assert.areSame( 400, lastResizeData.outerHeight, 'Outer height should be same as passed one in 2nd argument.' );
assert.areSame( 100, lastResizeData.outerWidth, 'Outer width should be same as passed one in 1st argument.' );
assert.areSame( getEditorContentHeight( editor ), lastResizeData.contentsHeight, 'Content height should be same as calculated one.' );
assert.areSame( 400, getEditorOuterHeight( editor ), 'Outer height should be properly set.' );
editor.resize( 100, 400, true );
assert.areSame( getEditorOuterHeight( editor ), lastResizeData.outerHeight, 'Outer height should be same as calculated one.' );
assert.areSame( 100, lastResizeData.outerWidth, 'Outer width should be same as passed one in 1st argument.' );
assert.areSame( 400, lastResizeData.contentsHeight, 'Content height should be same as passed one in 2nd argument.' );
assert.areSame( 400, getEditorContentHeight( editor ), 'Content height should be properly set.' );
}
} )
} )();