Browse Source

Merge pull request #692 in VISUAL/fineui from ~WINDY/fineui:master to master

* commit '95bfc7af7ea1ef2c7dfefc322c4c93442925d943':
  update
  update
  BI-32433
es6
guy 6 years ago
parent
commit
675dd4a401
  1. 71
      dist/base.js
  2. 79
      dist/bundle.js
  3. 56
      dist/bundle.min.js
  4. 79
      dist/fineui.js
  5. 56
      dist/fineui.min.js
  6. 79
      dist/fineui_without_jquery_polyfill.js
  7. 2
      dist/utils.min.js
  8. 8
      dist/widget.js
  9. 63
      src/base/combination/combo.js
  10. 8
      src/base/single/button/button.basic.js
  11. 4
      src/widget/downlist/combo.downlist.js
  12. 4
      src/widget/multilayerdownlist/combo.downlist.js

71
dist/base.js vendored

@ -915,7 +915,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
} }
}, },
_trigger: function () { _trigger: function (e) {
var o = this.options; var o = this.options;
if (!this.isEnabled()) { if (!this.isEnabled()) {
return; return;
@ -926,9 +926,9 @@ BI.BasicButton = BI.inherit(BI.Single, {
this.setSelected(!this.isSelected())); this.setSelected(!this.isSelected()));
} }
if (this.isValid()) { if (this.isValid()) {
o.handler.call(this, this.getValue(), this); o.handler.call(this, this.getValue(), this, e);
var v = this.getValue(); var v = this.getValue();
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, v, this); this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, v, this, e);
this.fireEvent(BI.BasicButton.EVENT_CHANGE, v, this); this.fireEvent(BI.BasicButton.EVENT_CHANGE, v, this);
if (o.action) { if (o.action) {
BI.Actions.runAction(o.action, "click", o); BI.Actions.runAction(o.action, "click", o);
@ -941,7 +941,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
if (this.isValid()) { if (this.isValid()) {
this.beforeClick(e); this.beforeClick(e);
} }
this._trigger(); this._trigger(e);
if (this.isValid()) { if (this.isValid()) {
this.doClick(e); this.doClick(e);
} }
@ -3204,13 +3204,13 @@ BI.Combo = BI.inherit(BI.Widget, {
this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW); this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW);
}, },
_popupView: function () { _popupView: function (e) {
this._assertPopupViewRender(); this._assertPopupViewRender();
this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW); this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW);
this.popupView.visible(); this.popupView.visible();
this.adjustWidth(); this.adjustWidth(e);
this.adjustHeight(); this.adjustHeight(e);
this.element.addClass(this.options.comboClass); this.element.addClass(this.options.comboClass);
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName()); BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
@ -3218,7 +3218,7 @@ BI.Combo = BI.inherit(BI.Widget, {
this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW); this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW);
}, },
adjustWidth: function () { adjustWidth: function (e) {
var o = this.options; var o = this.options;
if (!this.popupView) { if (!this.popupView) {
return; return;
@ -3236,59 +3236,84 @@ BI.Combo = BI.inherit(BI.Widget, {
} }
}, },
adjustHeight: function () { adjustHeight: function (e) {
var o = this.options, p = {}; var o = this.options, p = {};
if (!this.popupView) { if (!this.popupView) {
return; return;
} }
var isVisible = this.popupView.isVisible(); var isVisible = this.popupView.isVisible();
this.popupView.visible(); this.popupView.visible();
var combo = BI.isNotNull(e) ? {
element: {
offset: function () {
return {
left: e.pageX,
top: e.pageY
};
},
bounds: function () {
// offset为其相对于父定位元素的偏移
return {
x: e.offsetX,
y: e.offsetY,
width: 0,
height: 24
};
},
outerWidth: function () {
return 0;
},
outerHeight: function () {
return 24;
}
}
} : this.combo;
switch (o.direction) { switch (o.direction) {
case "bottom": case "bottom":
case "bottom,right": case "bottom,right":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "right", "left"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "right", "left"], o.offsetStyle);
break; break;
case "top": case "top":
case "top,right": case "top,right":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "right", "left"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "right", "left"], o.offsetStyle);
break; break;
case "left": case "left":
case "left,bottom": case "left,bottom":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "bottom", "top"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "bottom", "top"], o.offsetStyle);
break; break;
case "right": case "right":
case "right,bottom": case "right,bottom":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "bottom", "top"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "bottom", "top"], o.offsetStyle);
break; break;
case "top,left": case "top,left":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "left", "right"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "left", "right"], o.offsetStyle);
break; break;
case "bottom,left": case "bottom,left":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "left", "right"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "left", "right"], o.offsetStyle);
break; break;
case "left,top": case "left,top":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "top", "bottom"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "top", "bottom"], o.offsetStyle);
break; break;
case "right,top": case "right,top":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "top", "bottom"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "top", "bottom"], o.offsetStyle);
break; break;
case "top,custom": case "top,custom":
case "custom,top": case "custom,top":
p = $.getTopAdaptPosition(this.combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight); p = $.getTopAdaptPosition(combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight);
break; break;
case "custom,bottom": case "custom,bottom":
case "bottom,custom": case "bottom,custom":
p = $.getBottomAdaptPosition(this.combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight); p = $.getBottomAdaptPosition(combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight);
break; break;
case "left,custom": case "left,custom":
case "custom,left": case "custom,left":
p = $.getLeftAdaptPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength); p = $.getLeftAdaptPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength);
delete p.top; delete p.top;
delete p.adaptHeight; delete p.adaptHeight;
break; break;
case "custom,right": case "custom,right":
case "right,custom": case "right,custom":
p = $.getRightAdaptPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength); p = $.getRightAdaptPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength);
delete p.top; delete p.top;
delete p.adaptHeight; delete p.adaptHeight;
break; break;
@ -3359,9 +3384,9 @@ BI.Combo = BI.inherit(BI.Widget, {
return this.isEnabled() && this.combo.isEnabled() && !!this.popupView && this.popupView.isVisible(); return this.isEnabled() && this.combo.isEnabled() && !!this.popupView && this.popupView.isVisible();
}, },
showView: function () { showView: function (e) {
if (this.isEnabled() && this.combo.isEnabled()) { if (this.isEnabled() && this.combo.isEnabled()) {
this._popupView(); this._popupView(e);
} }
}, },

79
dist/bundle.js vendored

@ -36288,7 +36288,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
} }
}, },
_trigger: function () { _trigger: function (e) {
var o = this.options; var o = this.options;
if (!this.isEnabled()) { if (!this.isEnabled()) {
return; return;
@ -36299,9 +36299,9 @@ BI.BasicButton = BI.inherit(BI.Single, {
this.setSelected(!this.isSelected())); this.setSelected(!this.isSelected()));
} }
if (this.isValid()) { if (this.isValid()) {
o.handler.call(this, this.getValue(), this); o.handler.call(this, this.getValue(), this, e);
var v = this.getValue(); var v = this.getValue();
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, v, this); this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, v, this, e);
this.fireEvent(BI.BasicButton.EVENT_CHANGE, v, this); this.fireEvent(BI.BasicButton.EVENT_CHANGE, v, this);
if (o.action) { if (o.action) {
BI.Actions.runAction(o.action, "click", o); BI.Actions.runAction(o.action, "click", o);
@ -36314,7 +36314,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
if (this.isValid()) { if (this.isValid()) {
this.beforeClick(e); this.beforeClick(e);
} }
this._trigger(); this._trigger(e);
if (this.isValid()) { if (this.isValid()) {
this.doClick(e); this.doClick(e);
} }
@ -38577,13 +38577,13 @@ BI.Combo = BI.inherit(BI.Widget, {
this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW); this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW);
}, },
_popupView: function () { _popupView: function (e) {
this._assertPopupViewRender(); this._assertPopupViewRender();
this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW); this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW);
this.popupView.visible(); this.popupView.visible();
this.adjustWidth(); this.adjustWidth(e);
this.adjustHeight(); this.adjustHeight(e);
this.element.addClass(this.options.comboClass); this.element.addClass(this.options.comboClass);
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName()); BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
@ -38591,7 +38591,7 @@ BI.Combo = BI.inherit(BI.Widget, {
this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW); this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW);
}, },
adjustWidth: function () { adjustWidth: function (e) {
var o = this.options; var o = this.options;
if (!this.popupView) { if (!this.popupView) {
return; return;
@ -38609,59 +38609,84 @@ BI.Combo = BI.inherit(BI.Widget, {
} }
}, },
adjustHeight: function () { adjustHeight: function (e) {
var o = this.options, p = {}; var o = this.options, p = {};
if (!this.popupView) { if (!this.popupView) {
return; return;
} }
var isVisible = this.popupView.isVisible(); var isVisible = this.popupView.isVisible();
this.popupView.visible(); this.popupView.visible();
var combo = BI.isNotNull(e) ? {
element: {
offset: function () {
return {
left: e.pageX,
top: e.pageY
};
},
bounds: function () {
// offset为其相对于父定位元素的偏移
return {
x: e.offsetX,
y: e.offsetY,
width: 0,
height: 24
};
},
outerWidth: function () {
return 0;
},
outerHeight: function () {
return 24;
}
}
} : this.combo;
switch (o.direction) { switch (o.direction) {
case "bottom": case "bottom":
case "bottom,right": case "bottom,right":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "right", "left"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "right", "left"], o.offsetStyle);
break; break;
case "top": case "top":
case "top,right": case "top,right":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "right", "left"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "right", "left"], o.offsetStyle);
break; break;
case "left": case "left":
case "left,bottom": case "left,bottom":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "bottom", "top"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "bottom", "top"], o.offsetStyle);
break; break;
case "right": case "right":
case "right,bottom": case "right,bottom":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "bottom", "top"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "bottom", "top"], o.offsetStyle);
break; break;
case "top,left": case "top,left":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "left", "right"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "left", "right"], o.offsetStyle);
break; break;
case "bottom,left": case "bottom,left":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "left", "right"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "left", "right"], o.offsetStyle);
break; break;
case "left,top": case "left,top":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "top", "bottom"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "top", "bottom"], o.offsetStyle);
break; break;
case "right,top": case "right,top":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "top", "bottom"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "top", "bottom"], o.offsetStyle);
break; break;
case "top,custom": case "top,custom":
case "custom,top": case "custom,top":
p = $.getTopAdaptPosition(this.combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight); p = $.getTopAdaptPosition(combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight);
break; break;
case "custom,bottom": case "custom,bottom":
case "bottom,custom": case "bottom,custom":
p = $.getBottomAdaptPosition(this.combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight); p = $.getBottomAdaptPosition(combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight);
break; break;
case "left,custom": case "left,custom":
case "custom,left": case "custom,left":
p = $.getLeftAdaptPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength); p = $.getLeftAdaptPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength);
delete p.top; delete p.top;
delete p.adaptHeight; delete p.adaptHeight;
break; break;
case "custom,right": case "custom,right":
case "right,custom": case "right,custom":
p = $.getRightAdaptPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength); p = $.getRightAdaptPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength);
delete p.top; delete p.top;
delete p.adaptHeight; delete p.adaptHeight;
break; break;
@ -38732,9 +38757,9 @@ BI.Combo = BI.inherit(BI.Widget, {
return this.isEnabled() && this.combo.isEnabled() && !!this.popupView && this.popupView.isVisible(); return this.isEnabled() && this.combo.isEnabled() && !!this.popupView && this.popupView.isVisible();
}, },
showView: function () { showView: function (e) {
if (this.isEnabled() && this.combo.isEnabled()) { if (this.isEnabled() && this.combo.isEnabled()) {
this._popupView(); this._popupView(e);
} }
}, },
@ -60433,8 +60458,8 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
this.downlistcombo.hideView(); this.downlistcombo.hideView();
}, },
showView: function () { showView: function (e) {
this.downlistcombo.showView(); this.downlistcombo.showView(e);
}, },
populate: function (items) { populate: function (items) {
@ -64809,8 +64834,8 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
this.downlistcombo.hideView(); this.downlistcombo.hideView();
}, },
showView: function () { showView: function (e) {
this.downlistcombo.showView(); this.downlistcombo.showView(e);
}, },
populate: function (items) { populate: function (items) {

56
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

79
dist/fineui.js vendored

@ -36530,7 +36530,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
} }
}, },
_trigger: function () { _trigger: function (e) {
var o = this.options; var o = this.options;
if (!this.isEnabled()) { if (!this.isEnabled()) {
return; return;
@ -36541,9 +36541,9 @@ BI.BasicButton = BI.inherit(BI.Single, {
this.setSelected(!this.isSelected())); this.setSelected(!this.isSelected()));
} }
if (this.isValid()) { if (this.isValid()) {
o.handler.call(this, this.getValue(), this); o.handler.call(this, this.getValue(), this, e);
var v = this.getValue(); var v = this.getValue();
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, v, this); this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, v, this, e);
this.fireEvent(BI.BasicButton.EVENT_CHANGE, v, this); this.fireEvent(BI.BasicButton.EVENT_CHANGE, v, this);
if (o.action) { if (o.action) {
BI.Actions.runAction(o.action, "click", o); BI.Actions.runAction(o.action, "click", o);
@ -36556,7 +36556,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
if (this.isValid()) { if (this.isValid()) {
this.beforeClick(e); this.beforeClick(e);
} }
this._trigger(); this._trigger(e);
if (this.isValid()) { if (this.isValid()) {
this.doClick(e); this.doClick(e);
} }
@ -38819,13 +38819,13 @@ BI.Combo = BI.inherit(BI.Widget, {
this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW); this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW);
}, },
_popupView: function () { _popupView: function (e) {
this._assertPopupViewRender(); this._assertPopupViewRender();
this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW); this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW);
this.popupView.visible(); this.popupView.visible();
this.adjustWidth(); this.adjustWidth(e);
this.adjustHeight(); this.adjustHeight(e);
this.element.addClass(this.options.comboClass); this.element.addClass(this.options.comboClass);
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName()); BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
@ -38833,7 +38833,7 @@ BI.Combo = BI.inherit(BI.Widget, {
this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW); this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW);
}, },
adjustWidth: function () { adjustWidth: function (e) {
var o = this.options; var o = this.options;
if (!this.popupView) { if (!this.popupView) {
return; return;
@ -38851,59 +38851,84 @@ BI.Combo = BI.inherit(BI.Widget, {
} }
}, },
adjustHeight: function () { adjustHeight: function (e) {
var o = this.options, p = {}; var o = this.options, p = {};
if (!this.popupView) { if (!this.popupView) {
return; return;
} }
var isVisible = this.popupView.isVisible(); var isVisible = this.popupView.isVisible();
this.popupView.visible(); this.popupView.visible();
var combo = BI.isNotNull(e) ? {
element: {
offset: function () {
return {
left: e.pageX,
top: e.pageY
};
},
bounds: function () {
// offset为其相对于父定位元素的偏移
return {
x: e.offsetX,
y: e.offsetY,
width: 0,
height: 24
};
},
outerWidth: function () {
return 0;
},
outerHeight: function () {
return 24;
}
}
} : this.combo;
switch (o.direction) { switch (o.direction) {
case "bottom": case "bottom":
case "bottom,right": case "bottom,right":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "right", "left"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "right", "left"], o.offsetStyle);
break; break;
case "top": case "top":
case "top,right": case "top,right":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "right", "left"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "right", "left"], o.offsetStyle);
break; break;
case "left": case "left":
case "left,bottom": case "left,bottom":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "bottom", "top"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "bottom", "top"], o.offsetStyle);
break; break;
case "right": case "right":
case "right,bottom": case "right,bottom":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "bottom", "top"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "bottom", "top"], o.offsetStyle);
break; break;
case "top,left": case "top,left":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "left", "right"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "left", "right"], o.offsetStyle);
break; break;
case "bottom,left": case "bottom,left":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "left", "right"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "left", "right"], o.offsetStyle);
break; break;
case "left,top": case "left,top":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "top", "bottom"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "top", "bottom"], o.offsetStyle);
break; break;
case "right,top": case "right,top":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "top", "bottom"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "top", "bottom"], o.offsetStyle);
break; break;
case "top,custom": case "top,custom":
case "custom,top": case "custom,top":
p = $.getTopAdaptPosition(this.combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight); p = $.getTopAdaptPosition(combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight);
break; break;
case "custom,bottom": case "custom,bottom":
case "bottom,custom": case "bottom,custom":
p = $.getBottomAdaptPosition(this.combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight); p = $.getBottomAdaptPosition(combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight);
break; break;
case "left,custom": case "left,custom":
case "custom,left": case "custom,left":
p = $.getLeftAdaptPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength); p = $.getLeftAdaptPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength);
delete p.top; delete p.top;
delete p.adaptHeight; delete p.adaptHeight;
break; break;
case "custom,right": case "custom,right":
case "right,custom": case "right,custom":
p = $.getRightAdaptPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength); p = $.getRightAdaptPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength);
delete p.top; delete p.top;
delete p.adaptHeight; delete p.adaptHeight;
break; break;
@ -38974,9 +38999,9 @@ BI.Combo = BI.inherit(BI.Widget, {
return this.isEnabled() && this.combo.isEnabled() && !!this.popupView && this.popupView.isVisible(); return this.isEnabled() && this.combo.isEnabled() && !!this.popupView && this.popupView.isVisible();
}, },
showView: function () { showView: function (e) {
if (this.isEnabled() && this.combo.isEnabled()) { if (this.isEnabled() && this.combo.isEnabled()) {
this._popupView(); this._popupView(e);
} }
}, },
@ -60675,8 +60700,8 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
this.downlistcombo.hideView(); this.downlistcombo.hideView();
}, },
showView: function () { showView: function (e) {
this.downlistcombo.showView(); this.downlistcombo.showView(e);
}, },
populate: function (items) { populate: function (items) {
@ -65051,8 +65076,8 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
this.downlistcombo.hideView(); this.downlistcombo.hideView();
}, },
showView: function () { showView: function (e) {
this.downlistcombo.showView(); this.downlistcombo.showView(e);
}, },
populate: function (items) { populate: function (items) {

56
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

79
dist/fineui_without_jquery_polyfill.js vendored

@ -25098,7 +25098,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
} }
}, },
_trigger: function () { _trigger: function (e) {
var o = this.options; var o = this.options;
if (!this.isEnabled()) { if (!this.isEnabled()) {
return; return;
@ -25109,9 +25109,9 @@ BI.BasicButton = BI.inherit(BI.Single, {
this.setSelected(!this.isSelected())); this.setSelected(!this.isSelected()));
} }
if (this.isValid()) { if (this.isValid()) {
o.handler.call(this, this.getValue(), this); o.handler.call(this, this.getValue(), this, e);
var v = this.getValue(); var v = this.getValue();
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, v, this); this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, v, this, e);
this.fireEvent(BI.BasicButton.EVENT_CHANGE, v, this); this.fireEvent(BI.BasicButton.EVENT_CHANGE, v, this);
if (o.action) { if (o.action) {
BI.Actions.runAction(o.action, "click", o); BI.Actions.runAction(o.action, "click", o);
@ -25124,7 +25124,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
if (this.isValid()) { if (this.isValid()) {
this.beforeClick(e); this.beforeClick(e);
} }
this._trigger(); this._trigger(e);
if (this.isValid()) { if (this.isValid()) {
this.doClick(e); this.doClick(e);
} }
@ -26487,13 +26487,13 @@ BI.Combo = BI.inherit(BI.Widget, {
this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW); this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW);
}, },
_popupView: function () { _popupView: function (e) {
this._assertPopupViewRender(); this._assertPopupViewRender();
this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW); this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW);
this.popupView.visible(); this.popupView.visible();
this.adjustWidth(); this.adjustWidth(e);
this.adjustHeight(); this.adjustHeight(e);
this.element.addClass(this.options.comboClass); this.element.addClass(this.options.comboClass);
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName()); BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
@ -26501,7 +26501,7 @@ BI.Combo = BI.inherit(BI.Widget, {
this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW); this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW);
}, },
adjustWidth: function () { adjustWidth: function (e) {
var o = this.options; var o = this.options;
if (!this.popupView) { if (!this.popupView) {
return; return;
@ -26519,59 +26519,84 @@ BI.Combo = BI.inherit(BI.Widget, {
} }
}, },
adjustHeight: function () { adjustHeight: function (e) {
var o = this.options, p = {}; var o = this.options, p = {};
if (!this.popupView) { if (!this.popupView) {
return; return;
} }
var isVisible = this.popupView.isVisible(); var isVisible = this.popupView.isVisible();
this.popupView.visible(); this.popupView.visible();
var combo = BI.isNotNull(e) ? {
element: {
offset: function () {
return {
left: e.pageX,
top: e.pageY
};
},
bounds: function () {
// offset为其相对于父定位元素的偏移
return {
x: e.offsetX,
y: e.offsetY,
width: 0,
height: 24
};
},
outerWidth: function () {
return 0;
},
outerHeight: function () {
return 24;
}
}
} : this.combo;
switch (o.direction) { switch (o.direction) {
case "bottom": case "bottom":
case "bottom,right": case "bottom,right":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "right", "left"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "right", "left"], o.offsetStyle);
break; break;
case "top": case "top":
case "top,right": case "top,right":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "right", "left"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "right", "left"], o.offsetStyle);
break; break;
case "left": case "left":
case "left,bottom": case "left,bottom":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "bottom", "top"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "bottom", "top"], o.offsetStyle);
break; break;
case "right": case "right":
case "right,bottom": case "right,bottom":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "bottom", "top"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "bottom", "top"], o.offsetStyle);
break; break;
case "top,left": case "top,left":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "left", "right"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "left", "right"], o.offsetStyle);
break; break;
case "bottom,left": case "bottom,left":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "left", "right"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "left", "right"], o.offsetStyle);
break; break;
case "left,top": case "left,top":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "top", "bottom"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "top", "bottom"], o.offsetStyle);
break; break;
case "right,top": case "right,top":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "top", "bottom"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "top", "bottom"], o.offsetStyle);
break; break;
case "top,custom": case "top,custom":
case "custom,top": case "custom,top":
p = $.getTopAdaptPosition(this.combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight); p = $.getTopAdaptPosition(combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight);
break; break;
case "custom,bottom": case "custom,bottom":
case "bottom,custom": case "bottom,custom":
p = $.getBottomAdaptPosition(this.combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight); p = $.getBottomAdaptPosition(combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight);
break; break;
case "left,custom": case "left,custom":
case "custom,left": case "custom,left":
p = $.getLeftAdaptPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength); p = $.getLeftAdaptPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength);
delete p.top; delete p.top;
delete p.adaptHeight; delete p.adaptHeight;
break; break;
case "custom,right": case "custom,right":
case "right,custom": case "right,custom":
p = $.getRightAdaptPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength); p = $.getRightAdaptPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength);
delete p.top; delete p.top;
delete p.adaptHeight; delete p.adaptHeight;
break; break;
@ -26642,9 +26667,9 @@ BI.Combo = BI.inherit(BI.Widget, {
return this.isEnabled() && this.combo.isEnabled() && !!this.popupView && this.popupView.isVisible(); return this.isEnabled() && this.combo.isEnabled() && !!this.popupView && this.popupView.isVisible();
}, },
showView: function () { showView: function (e) {
if (this.isEnabled() && this.combo.isEnabled()) { if (this.isEnabled() && this.combo.isEnabled()) {
this._popupView(); this._popupView(e);
} }
}, },
@ -43559,8 +43584,8 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
this.downlistcombo.hideView(); this.downlistcombo.hideView();
}, },
showView: function () { showView: function (e) {
this.downlistcombo.showView(); this.downlistcombo.showView(e);
}, },
populate: function (items) { populate: function (items) {
@ -47935,8 +47960,8 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
this.downlistcombo.hideView(); this.downlistcombo.hideView();
}, },
showView: function () { showView: function (e) {
this.downlistcombo.showView(); this.downlistcombo.showView(e);
}, },
populate: function (items) { populate: function (items) {

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

8
dist/widget.js vendored

@ -1882,8 +1882,8 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
this.downlistcombo.hideView(); this.downlistcombo.hideView();
}, },
showView: function () { showView: function (e) {
this.downlistcombo.showView(); this.downlistcombo.showView(e);
}, },
populate: function (items) { populate: function (items) {
@ -6258,8 +6258,8 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
this.downlistcombo.hideView(); this.downlistcombo.hideView();
}, },
showView: function () { showView: function (e) {
this.downlistcombo.showView(); this.downlistcombo.showView(e);
}, },
populate: function (items) { populate: function (items) {

63
src/base/combination/combo.js

@ -288,13 +288,13 @@ BI.Combo = BI.inherit(BI.Widget, {
this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW); this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW);
}, },
_popupView: function () { _popupView: function (e) {
this._assertPopupViewRender(); this._assertPopupViewRender();
this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW); this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW);
this.popupView.visible(); this.popupView.visible();
this.adjustWidth(); this.adjustWidth(e);
this.adjustHeight(); this.adjustHeight(e);
this.element.addClass(this.options.comboClass); this.element.addClass(this.options.comboClass);
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName()); BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
@ -302,7 +302,7 @@ BI.Combo = BI.inherit(BI.Widget, {
this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW); this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW);
}, },
adjustWidth: function () { adjustWidth: function (e) {
var o = this.options; var o = this.options;
if (!this.popupView) { if (!this.popupView) {
return; return;
@ -320,59 +320,84 @@ BI.Combo = BI.inherit(BI.Widget, {
} }
}, },
adjustHeight: function () { adjustHeight: function (e) {
var o = this.options, p = {}; var o = this.options, p = {};
if (!this.popupView) { if (!this.popupView) {
return; return;
} }
var isVisible = this.popupView.isVisible(); var isVisible = this.popupView.isVisible();
this.popupView.visible(); this.popupView.visible();
var combo = BI.isNotNull(e) ? {
element: {
offset: function () {
return {
left: e.pageX,
top: e.pageY
};
},
bounds: function () {
// offset为其相对于父定位元素的偏移
return {
x: e.offsetX,
y: e.offsetY,
width: 0,
height: 24
};
},
outerWidth: function () {
return 0;
},
outerHeight: function () {
return 24;
}
}
} : this.combo;
switch (o.direction) { switch (o.direction) {
case "bottom": case "bottom":
case "bottom,right": case "bottom,right":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "right", "left"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "right", "left"], o.offsetStyle);
break; break;
case "top": case "top":
case "top,right": case "top,right":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "right", "left"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "right", "left"], o.offsetStyle);
break; break;
case "left": case "left":
case "left,bottom": case "left,bottom":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "bottom", "top"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "bottom", "top"], o.offsetStyle);
break; break;
case "right": case "right":
case "right,bottom": case "right,bottom":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "bottom", "top"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "bottom", "top"], o.offsetStyle);
break; break;
case "top,left": case "top,left":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "left", "right"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "left", "right"], o.offsetStyle);
break; break;
case "bottom,left": case "bottom,left":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "left", "right"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "left", "right"], o.offsetStyle);
break; break;
case "left,top": case "left,top":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "top", "bottom"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "top", "bottom"], o.offsetStyle);
break; break;
case "right,top": case "right,top":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "top", "bottom"], o.offsetStyle); p = $.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "top", "bottom"], o.offsetStyle);
break; break;
case "top,custom": case "top,custom":
case "custom,top": case "custom,top":
p = $.getTopAdaptPosition(this.combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight); p = $.getTopAdaptPosition(combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight);
break; break;
case "custom,bottom": case "custom,bottom":
case "bottom,custom": case "bottom,custom":
p = $.getBottomAdaptPosition(this.combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight); p = $.getBottomAdaptPosition(combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight);
break; break;
case "left,custom": case "left,custom":
case "custom,left": case "custom,left":
p = $.getLeftAdaptPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength); p = $.getLeftAdaptPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength);
delete p.top; delete p.top;
delete p.adaptHeight; delete p.adaptHeight;
break; break;
case "custom,right": case "custom,right":
case "right,custom": case "right,custom":
p = $.getRightAdaptPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength); p = $.getRightAdaptPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength);
delete p.top; delete p.top;
delete p.adaptHeight; delete p.adaptHeight;
break; break;
@ -443,9 +468,9 @@ BI.Combo = BI.inherit(BI.Widget, {
return this.isEnabled() && this.combo.isEnabled() && !!this.popupView && this.popupView.isVisible(); return this.isEnabled() && this.combo.isEnabled() && !!this.popupView && this.popupView.isVisible();
}, },
showView: function () { showView: function (e) {
if (this.isEnabled() && this.combo.isEnabled()) { if (this.isEnabled() && this.combo.isEnabled()) {
this._popupView(); this._popupView(e);
} }
}, },

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

@ -285,7 +285,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
} }
}, },
_trigger: function () { _trigger: function (e) {
var o = this.options; var o = this.options;
if (!this.isEnabled()) { if (!this.isEnabled()) {
return; return;
@ -296,9 +296,9 @@ BI.BasicButton = BI.inherit(BI.Single, {
this.setSelected(!this.isSelected())); this.setSelected(!this.isSelected()));
} }
if (this.isValid()) { if (this.isValid()) {
o.handler.call(this, this.getValue(), this); o.handler.call(this, this.getValue(), this, e);
var v = this.getValue(); var v = this.getValue();
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, v, this); this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, v, this, e);
this.fireEvent(BI.BasicButton.EVENT_CHANGE, v, this); this.fireEvent(BI.BasicButton.EVENT_CHANGE, v, this);
if (o.action) { if (o.action) {
BI.Actions.runAction(o.action, "click", o); BI.Actions.runAction(o.action, "click", o);
@ -311,7 +311,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
if (this.isValid()) { if (this.isValid()) {
this.beforeClick(e); this.beforeClick(e);
} }
this._trigger(); this._trigger(e);
if (this.isValid()) { if (this.isValid()) {
this.doClick(e); this.doClick(e);
} }

4
src/widget/downlist/combo.downlist.js

@ -69,8 +69,8 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
this.downlistcombo.hideView(); this.downlistcombo.hideView();
}, },
showView: function () { showView: function (e) {
this.downlistcombo.showView(); this.downlistcombo.showView(e);
}, },
populate: function (items) { populate: function (items) {

4
src/widget/multilayerdownlist/combo.downlist.js

@ -68,8 +68,8 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
this.downlistcombo.hideView(); this.downlistcombo.hideView();
}, },
showView: function () { showView: function (e) {
this.downlistcombo.showView(); this.downlistcombo.showView(e);
}, },
populate: function (items) { populate: function (items) {

Loading…
Cancel
Save