From b71cae0184191c676956732f0101767c7649040c Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 4 Dec 2021 15:16:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/button/button.node.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/base/single/button/button.node.js b/src/base/single/button/button.node.js index 553ab850f..8e17a4ea5 100644 --- a/src/base/single/button/button.node.js +++ b/src/base/single/button/button.node.js @@ -9,14 +9,16 @@ BI.NodeButton = BI.inherit(BI.BasicButton, { _defaultConfig: function () { var conf = BI.NodeButton.superclass._defaultConfig.apply(this, arguments); - return BI.extend( conf, { + return BI.extend(conf, { _baseCls: (conf._baseCls || "") + " bi-node", open: false }); }, _initRef: function () { - this.setOpened(this.isOpened()); + if (this.isOpened()) { + this.setOpened(this.isOpened()); + } BI.NodeButton.superclass._initRef.apply(this, arguments); }, @@ -38,14 +40,14 @@ BI.NodeButton = BI.inherit(BI.BasicButton, { }, triggerCollapse: function () { - if(this.isOpened()) { + if (this.isOpened()) { this.setOpened(false); this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, this.getValue(), this); } }, triggerExpand: function () { - if(!this.isOpened()) { + if (!this.isOpened()) { this.setOpened(true); this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, this.getValue(), this); }