Browse Source

Pull request #2318: 无JIRA任务 优化代码

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit 'b71cae0184191c676956732f0101767c7649040c':
  优化代码
es6
guy 3 years ago
parent
commit
7f3ae20fbc
  1. 10
      src/base/single/button/button.node.js

10
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);
}

Loading…
Cancel
Save