Browse Source

Pull request #2311: 无JIRA任务 update

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

* commit 'c465a7f2ca32141d78679f942d6a0278b90820c7':
  update
  update
  update
es6
guy 3 years ago
parent
commit
77d4887437
  1. 16
      src/base/single/button/button.basic.js
  2. 9
      src/base/single/button/button.node.js

16
src/base/single/button/button.basic.js

@ -31,13 +31,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
_init: function () { _init: function () {
BI.BasicButton.superclass._init.apply(this, arguments); BI.BasicButton.superclass._init.apply(this, arguments);
var opts = this.options; var opts = this.options;
if (opts.selected === true) {
BI.nextTick(BI.bind(function () {
this.setSelected(opts.selected);
}, this));
}
BI.nextTick(BI.bind(this.bindEvent, this));
if (opts.shadow) { if (opts.shadow) {
this._createShadow(); this._createShadow();
} }
@ -46,6 +40,14 @@ BI.BasicButton = BI.inherit(BI.Single, {
} }
}, },
_initRef: function () {
if (this.options.selected === true) {
this.setSelected(true);
}
this.bindEvent();
BI.BasicButton.superclass._initRef.apply(this, arguments);
},
// 默认render方法 // 默认render方法
render: function () { render: function () {
return this.options.el; return this.options.el;

9
src/base/single/button/button.node.js

@ -15,12 +15,9 @@ BI.NodeButton = BI.inherit(BI.BasicButton, {
}); });
}, },
_init: function () { _initRef: function () {
BI.NodeButton.superclass._init.apply(this, arguments); this.setOpened(this.isOpened());
var self = this; BI.NodeButton.superclass._initRef.apply(this, arguments);
BI.nextTick(function () {
self.setOpened(self.isOpened());
});
}, },
doClick: function () { doClick: function () {

Loading…
Cancel
Save