Commit 952651e Park Hyunwoo
committed
1 parent 7dde8b3 commit 952651e Copy full SHA for 952651e
File tree 2 files changed +15
-17
lines changed
2 files changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ define([
54
54
*/
55
55
this . activate = function ( ) {
56
56
$codable . val ( dom . html ( $editable , options . prettifyHtml ) ) ;
57
+ $codable . width ( $editable . width ( ) ) ;
57
58
$codable . height ( $editable . height ( ) ) ;
58
59
59
60
context . invoke ( 'toolbar.updateCodeview' , true ) ;
@@ -74,7 +75,7 @@ define([
74
75
}
75
76
76
77
// CodeMirror hasn't Padding.
77
- cmEditor . setSize ( null , $editable . outerHeight ( ) ) ;
78
+ cmEditor . setSize ( $editable . outerWidth ( ) , $editable . outerHeight ( ) ) ;
78
79
$codable . data ( 'cmEditor' , cmEditor ) ;
79
80
}
80
81
} ;
@@ -94,7 +95,6 @@ define([
94
95
var isChange = $editable . html ( ) !== value ;
95
96
96
97
$editable . html ( value ) ;
97
- $editable . height ( options . height ? $codable . height ( ) : 'auto' ) ;
98
98
$editor . removeClass ( 'codeview' ) ;
99
99
100
100
if ( isChange ) {
Original file line number Diff line number Diff line change @@ -82,14 +82,19 @@ define([
82
82
context . triggerEvent ( 'focusout' , event ) ;
83
83
} ) ;
84
84
85
- if ( ! options . airMode && options . height ) {
86
- this . setHeight ( options . height ) ;
87
- }
88
- if ( ! options . airMode && options . maxHeight ) {
89
- $editable . css ( 'max-height' , options . maxHeight ) ;
90
- }
91
- if ( ! options . airMode && options . minHeight ) {
92
- $editable . css ( 'min-height' , options . minHeight ) ;
85
+ if ( ! options . airMode ) {
86
+ if ( options . width ) {
87
+ $editable . outerWidth ( options . width ) ;
88
+ }
89
+ if ( options . height ) {
90
+ $editable . outerHeight ( options . height ) ;
91
+ }
92
+ if ( options . maxHeight ) {
93
+ $editable . css ( 'max-height' , options . maxHeight ) ;
94
+ }
95
+ if ( options . minHeight ) {
96
+ $editable . css ( 'min-height' , options . minHeight ) ;
97
+ }
93
98
}
94
99
95
100
history . recordUndo ( ) ;
@@ -733,13 +738,6 @@ define([
733
738
this . empty = function ( ) {
734
739
context . invoke ( 'code' , dom . emptyPara ) ;
735
740
} ;
736
-
737
- /**
738
- * set height for editable
739
- */
740
- this . setHeight = function ( height ) {
741
- $editable . outerHeight ( height ) ;
742
- } ;
743
741
} ;
744
742
745
743
return Editor ;
You can’t perform that action at this time.
0 commit comments