From 58f67ce04e9a743e085f1bc9f845f899038c4a2c Mon Sep 17 00:00:00 2001 From: VisualSJ Date: Tue, 18 Oct 2016 11:14:16 +0800 Subject: [PATCH] Synchronization code to the 1.2 branch --- cocos2d/core/editbox/CCSGEditBox.js | 5 +++++ cocos2d/core/platform/CCSys.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cocos2d/core/editbox/CCSGEditBox.js b/cocos2d/core/editbox/CCSGEditBox.js index 3d779c8a65..57ee1a9d22 100644 --- a/cocos2d/core/editbox/CCSGEditBox.js +++ b/cocos2d/core/editbox/CCSGEditBox.js @@ -627,6 +627,8 @@ _ccsg.EditBox.KeyboardReturnType = KeyboardReturnType; } else { thisPointer.__fullscreen = false; } + this.__autoResize = cc.view.__resizeWithBrowserSize; + cc.view.resizeWithBrowserSize(false); scrollWindowUp(editBox); @@ -641,6 +643,9 @@ _ccsg.EditBox.KeyboardReturnType = KeyboardReturnType; if(thisPointer.__fullscreen) { cc.view.enableAutoFullScreen(true); } + if (this.__autoResize) { + cc.view.resizeWithBrowserSize(true); + } window.scrollY = 0; if (editBox._delegate && editBox._delegate.editBoxEditingDidEnded) { editBox._delegate.editBoxEditingDidEnded(editBox); diff --git a/cocos2d/core/platform/CCSys.js b/cocos2d/core/platform/CCSys.js index 611b70eab7..03ce765d18 100644 --- a/cocos2d/core/platform/CCSys.js +++ b/cocos2d/core/platform/CCSys.js @@ -490,7 +490,7 @@ else { * Indicate whether system is mobile system * @property {Boolean} isMobile */ - sys.isMobile = /mobile|android|mqqbrowser|micromessenger|miuibrowser/.test(ua); + sys.isMobile = /mobile|android|iphone|ipad/.test(ua); /** * Indicate the running platform