@@ -265,6 +265,7 @@ cc.EditBox = cc.ControlButton.extend({
265
265
tmpEdTxt . style . padding = "0" ;
266
266
267
267
this . __fullscreen = false ;
268
+ this . __autoResize = false ;
268
269
var onCanvasClick = function ( ) { this . _edTxt . blur ( ) ; } ;
269
270
this . _onCanvasClick = onCanvasClick . bind ( this ) ;
270
271
@@ -285,13 +286,15 @@ cc.EditBox = cc.ControlButton.extend({
285
286
this . _keyPressEvent = keypressEvent . bind ( this ) ;
286
287
var focusEvent = function ( ) {
287
288
// Exit fullscreen
288
- if ( cc . view . isAutoFullScreenEnabled ( ) ) {
289
+ if ( cc . view . isAutoFullScreenEnabled ( ) ) {
289
290
this . __fullscreen = true ;
290
291
cc . view . enableAutoFullScreen ( false ) ;
291
292
cc . screen . exitFullScreen ( ) ;
292
293
} else {
293
294
this . __fullscreen = false ;
294
295
}
296
+ this . __autoResize = cc . view . __resizeWithBrowserSize ;
297
+ cc . view . resizeWithBrowserSize ( false ) ;
295
298
296
299
if ( this . _edTxt . value === this . _placeholderText ) {
297
300
this . _edTxt . value = "" ;
@@ -309,9 +312,12 @@ cc.EditBox = cc.ControlButton.extend({
309
312
this . _focusEvent = focusEvent . bind ( this ) ;
310
313
var blurEvent = function ( ) {
311
314
// Resume fullscreen logic
312
- if ( this . __fullscreen ) {
315
+ if ( this . __fullscreen ) {
313
316
cc . view . enableAutoFullScreen ( true ) ;
314
317
}
318
+ if ( this . __autoResize ) {
319
+ cc . view . resizeWithBrowserSize ( true ) ;
320
+ }
315
321
316
322
if ( this . _edTxt . value === "" ) {
317
323
this . _edTxt . value = this . _placeholderText ;
0 commit comments