From 496639bcf104018fd4792f89b3f495ee79711d58 Mon Sep 17 00:00:00 2001 From: Jare Guo Date: Thu, 2 Nov 2017 12:24:37 -0500 Subject: [PATCH 1/2] Update PULL_REQUEST_TEMPLATE.md --- .github/PULL_REQUEST_TEMPLATE.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0ab8024e6e..407619de4a 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,6 @@ Re: cocos-creator/fireball# -Changes proposed in this pull request: +Changelog: * > Makes sure these boxes are checked before submitting your PR - thank you! @@ -11,5 +11,3 @@ Changes proposed in this pull request: - [ ] Check that your javascript is following our [style guide](https://github.com/cocos-creator/fireball/blob/dev/.github/CONTRIBUTING.md) and end files with a newline - [ ] Document new code with comments in source code based on [API Docs](https://github.com/cocos-creator/fireball#api-docs) - [ ] Make sure any runtime log information in `cc.log` , `cc.error`, `cc.warn` or `cc.assert` has been moved into `DebugInfos.js` with an ID - -@cocos-creator/engine-admins From 03f04a4e896e4766da6611732ac83cca5317dd94 Mon Sep 17 00:00:00 2001 From: knoxHuang <821686174@qq.com> Date: Fri, 3 Nov 2017 09:27:16 +0800 Subject: [PATCH 2/2] restore toggleGroup code --- DebugInfos.js | 2 -- cocos2d/core/components/CCToggleGroup.js | 19 +++++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/DebugInfos.js b/DebugInfos.js index 78e9e433a2..602043725d 100644 --- a/DebugInfos.js +++ b/DebugInfos.js @@ -618,8 +618,6 @@ if (CC_DEBUG) { "8301": "Camera does not support Canvas Mode.", //cc.Camera.enabled // AudioEngine: 8400 "8400": "Wrong type arguments, 'filePath' must be a String.", // cc.audioEngine.play - // ToggleGroup: 8500 - "8500": "The ToggleGroup.toggleItems api will be removed in v2.0, please obtain toggles in other ways. \uD83D\uDE30", }; cc._LogInfos = logs; } diff --git a/cocos2d/core/components/CCToggleGroup.js b/cocos2d/core/components/CCToggleGroup.js index 6035b0f60d..6a53c0a03a 100644 --- a/cocos2d/core/components/CCToggleGroup.js +++ b/cocos2d/core/components/CCToggleGroup.js @@ -54,6 +54,17 @@ var ToggleGroup = cc.Class({ tooltip: CC_DEV && 'i18n:COMPONENT.toggle_group.allowSwitchOff', default: false }, + + /** + * !#en Read only property, return the toggle items array reference managed by toggleGroup. + * !#zh 只读属性,返回 toggleGroup 管理的 toggle 数组引用 + * @property {Array} toggleItems + */ + toggleItems: { + get: function () { + return this._toggleItems; + } + } }, updateToggles: function (toggle) { @@ -112,14 +123,6 @@ var ToggleGroup = cc.Class({ start: function () { this._makeAtLeastOneToggleChecked(); } - -}); - -var JS = require('../platform/js'); - -JS.get(ToggleGroup.prototype, 'toggleItems', function () { - cc.warnID(8500); - return this._toggleItems; }); cc.ToggleGroup = module.exports = ToggleGroup;