Browse Source

BI-17954

处理点击组件bi.multi_select_bar中text区域内容仅会在组件内部发生状态改变而不对触发事件的问题
es6
MrErHu 7 years ago
parent
commit
c283c67f0d
  1. 32
      dist/_fineui.min.js
  2. 43
      dist/bundle.js
  3. 30
      dist/bundle.min.js
  4. 43
      dist/case.js
  5. 32
      dist/fineui.min.js
  6. 43
      src/case/toolbar/toolbar.multiselect.js

32
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

43
dist/bundle.js vendored

@ -85543,26 +85543,6 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, {
}, },
invisible: isSelect || !isHalfSelect invisible: isSelect || !isHalfSelect
}); });
this.text = BI.createWidget({
type: "bi.text_button",
stopPropagation: true,
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py,
handler: function () {
if (self.isHalfSelected()) {
this.setSelected(true);
} else {
this.setSelected(!this.isSelected());
}
}
});
this.checkbox.on(BI.Controller.EVENT_CHANGE, function () { this.checkbox.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, self.isSelected(), self); self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, self.isSelected(), self);
}); });
@ -85572,17 +85552,23 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, {
this.half.on(BI.Controller.EVENT_CHANGE, function () { this.half.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, self.isSelected(), self); self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, self.isSelected(), self);
}); });
this.text.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, self.isSelected(), self);
});
this.half.on(BI.HalfIconButton.EVENT_CHANGE, function () { this.half.on(BI.HalfIconButton.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE, self.isSelected(), self); self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE, self.isSelected(), self);
}); });
this.checkbox.on(BI.Checkbox.EVENT_CHANGE, function () { this.checkbox.on(BI.Checkbox.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE, self.isSelected(), self); self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE, self.isSelected(), self);
}); });
this.text.on(BI.TextButton.EVENT_CHANGE, function () { this.text = BI.createWidget({
self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE, self.isSelected(), self); type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py
}); });
BI.createWidget({ BI.createWidget({
type: "bi.htape", type: "bi.htape",
@ -85643,6 +85629,13 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, {
var isAllChecked = this.options.isAllCheckedBySelectedValue.apply(this, arguments); var isAllChecked = this.options.isAllCheckedBySelectedValue.apply(this, arguments);
this._setSelected(isAllChecked); this._setSelected(isAllChecked);
!isAllChecked && this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this, arguments)); !isAllChecked && this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this, arguments));
},
doClick: function () {
BI.MultiSelectBar.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.MultiSelectBar.EVENT_CHANGE);
}
} }
}); });
BI.MultiSelectBar.EVENT_CHANGE = "MultiSelectBar.EVENT_CHANGE"; BI.MultiSelectBar.EVENT_CHANGE = "MultiSelectBar.EVENT_CHANGE";

30
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

43
dist/case.js vendored

@ -13094,26 +13094,6 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, {
}, },
invisible: isSelect || !isHalfSelect invisible: isSelect || !isHalfSelect
}); });
this.text = BI.createWidget({
type: "bi.text_button",
stopPropagation: true,
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py,
handler: function () {
if (self.isHalfSelected()) {
this.setSelected(true);
} else {
this.setSelected(!this.isSelected());
}
}
});
this.checkbox.on(BI.Controller.EVENT_CHANGE, function () { this.checkbox.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, self.isSelected(), self); self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, self.isSelected(), self);
}); });
@ -13123,17 +13103,23 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, {
this.half.on(BI.Controller.EVENT_CHANGE, function () { this.half.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, self.isSelected(), self); self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, self.isSelected(), self);
}); });
this.text.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, self.isSelected(), self);
});
this.half.on(BI.HalfIconButton.EVENT_CHANGE, function () { this.half.on(BI.HalfIconButton.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE, self.isSelected(), self); self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE, self.isSelected(), self);
}); });
this.checkbox.on(BI.Checkbox.EVENT_CHANGE, function () { this.checkbox.on(BI.Checkbox.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE, self.isSelected(), self); self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE, self.isSelected(), self);
}); });
this.text.on(BI.TextButton.EVENT_CHANGE, function () { this.text = BI.createWidget({
self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE, self.isSelected(), self); type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py
}); });
BI.createWidget({ BI.createWidget({
type: "bi.htape", type: "bi.htape",
@ -13194,6 +13180,13 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, {
var isAllChecked = this.options.isAllCheckedBySelectedValue.apply(this, arguments); var isAllChecked = this.options.isAllCheckedBySelectedValue.apply(this, arguments);
this._setSelected(isAllChecked); this._setSelected(isAllChecked);
!isAllChecked && this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this, arguments)); !isAllChecked && this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this, arguments));
},
doClick: function () {
BI.MultiSelectBar.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.MultiSelectBar.EVENT_CHANGE);
}
} }
}); });
BI.MultiSelectBar.EVENT_CHANGE = "MultiSelectBar.EVENT_CHANGE"; BI.MultiSelectBar.EVENT_CHANGE = "MultiSelectBar.EVENT_CHANGE";

32
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

43
src/case/toolbar/toolbar.multiselect.js

@ -42,26 +42,6 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, {
}, },
invisible: isSelect || !isHalfSelect invisible: isSelect || !isHalfSelect
}); });
this.text = BI.createWidget({
type: "bi.text_button",
stopPropagation: true,
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py,
handler: function () {
if (self.isHalfSelected()) {
this.setSelected(true);
} else {
this.setSelected(!this.isSelected());
}
}
});
this.checkbox.on(BI.Controller.EVENT_CHANGE, function () { this.checkbox.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, self.isSelected(), self); self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, self.isSelected(), self);
}); });
@ -71,17 +51,23 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, {
this.half.on(BI.Controller.EVENT_CHANGE, function () { this.half.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, self.isSelected(), self); self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, self.isSelected(), self);
}); });
this.text.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, self.isSelected(), self);
});
this.half.on(BI.HalfIconButton.EVENT_CHANGE, function () { this.half.on(BI.HalfIconButton.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE, self.isSelected(), self); self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE, self.isSelected(), self);
}); });
this.checkbox.on(BI.Checkbox.EVENT_CHANGE, function () { this.checkbox.on(BI.Checkbox.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE, self.isSelected(), self); self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE, self.isSelected(), self);
}); });
this.text.on(BI.TextButton.EVENT_CHANGE, function () { this.text = BI.createWidget({
self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE, self.isSelected(), self); type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py
}); });
BI.createWidget({ BI.createWidget({
type: "bi.htape", type: "bi.htape",
@ -142,6 +128,13 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, {
var isAllChecked = this.options.isAllCheckedBySelectedValue.apply(this, arguments); var isAllChecked = this.options.isAllCheckedBySelectedValue.apply(this, arguments);
this._setSelected(isAllChecked); this._setSelected(isAllChecked);
!isAllChecked && this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this, arguments)); !isAllChecked && this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this, arguments));
},
doClick: function () {
BI.MultiSelectBar.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.MultiSelectBar.EVENT_CHANGE);
}
} }
}); });
BI.MultiSelectBar.EVENT_CHANGE = "MultiSelectBar.EVENT_CHANGE"; BI.MultiSelectBar.EVENT_CHANGE = "MultiSelectBar.EVENT_CHANGE";

Loading…
Cancel
Save