@@ -263,6 +263,8 @@ cc.EditBox = cc.ControlButton.extend({
263
263
tmpEdTxt . style . active = 0 ;
264
264
tmpEdTxt . style . outline = "medium" ;
265
265
tmpEdTxt . style . padding = "0" ;
266
+
267
+ this . __fullscreen = false ;
266
268
var onCanvasClick = function ( ) { this . _edTxt . blur ( ) ; } ;
267
269
this . _onCanvasClick = onCanvasClick . bind ( this ) ;
268
270
@@ -282,6 +284,15 @@ cc.EditBox = cc.ControlButton.extend({
282
284
} ;
283
285
this . _keyPressEvent = keypressEvent . bind ( this ) ;
284
286
var focusEvent = function ( ) {
287
+ // Exit fullscreen
288
+ if ( cc . view . isAutoFullScreenEnabled ( ) ) {
289
+ this . __fullscreen = true ;
290
+ cc . view . enableAutoFullScreen ( false ) ;
291
+ cc . screen . exitFullScreen ( ) ;
292
+ } else {
293
+ this . __fullscreen = false ;
294
+ }
295
+
285
296
if ( this . _edTxt . value === this . _placeholderText ) {
286
297
this . _edTxt . value = "" ;
287
298
this . _edTxt . style . fontSize = this . _edFontSize + "px" ;
@@ -297,6 +308,11 @@ cc.EditBox = cc.ControlButton.extend({
297
308
} ;
298
309
this . _focusEvent = focusEvent . bind ( this ) ;
299
310
var blurEvent = function ( ) {
311
+ // Resume fullscreen logic
312
+ if ( this . __fullscreen ) {
313
+ cc . view . enableAutoFullScreen ( true ) ;
314
+ }
315
+
300
316
if ( this . _edTxt . value === "" ) {
301
317
this . _edTxt . value = this . _placeholderText ;
302
318
this . _edTxt . style . fontSize = this . _placeholderFontSize + "px" ;
0 commit comments