Browse Source

BI-10839 combo

es6
Young 7 years ago
parent
commit
600754aa61
  1. 43
      bi/base.js
  2. 2
      bi/case.js
  3. 2
      demo/js/case/combo/demo.icon_combo.js
  4. 43
      dist/base.js
  5. 45
      dist/bundle.js
  6. 2
      dist/case.js
  7. 2
      dist/demo.js
  8. 43
      src/base/combination/combo.js
  9. 2
      src/case/combo/iconcombo/combo.icon.js

43
bi/base.js

@ -3008,6 +3008,19 @@ BI.Combo = BI.inherit(BI.Widget, {
e.stopPropagation();
}
};
var enterPopup = false;
function hide() {
if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid() && o.toggle === true) {
self._hideView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo);
self.fireEvent(BI.Combo.EVENT_COLLAPSE);
}
self.popupView && self.popupView.element.off("mouseenter." + self.getName()).off("mouseleave." + self.getName());
enterPopup = false;
}
BI.each(evs, function (i, ev) {
switch (ev) {
case "hover":
@ -3019,11 +3032,18 @@ BI.Combo = BI.inherit(BI.Widget, {
}
});
self.element.on("mouseleave." + self.getName(), function (e) {
if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid() && o.toggle === true) {
self._hideView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo);
self.fireEvent(BI.Combo.EVENT_COLLAPSE);
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
});
self.popupView.element.off("mouseenter." + self.getName());
});
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
});
break;
case "click":
@ -3069,11 +3089,18 @@ BI.Combo = BI.inherit(BI.Widget, {
st(e);
});
self.element.on("mouseleave." + self.getName(), function (e) {
if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid() && o.toggle === true) {
self._hideView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo);
self.fireEvent(BI.Combo.EVENT_COLLAPSE);
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
});
self.popupView.element.off("mouseenter." + self.getName());
});
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
});
break;
}

2
bi/case.js

@ -5260,6 +5260,8 @@ BI.IconCombo = BI.inherit(BI.Widget, {
type: "bi.combo",
element: this,
direction: o.direction,
trigger: o.trigger,
container: o.container,
adjustLength: o.adjustLength,
adjustXOffset: o.adjustXOffset,
adjustYOffset: o.adjustYOffset,

2
demo/js/case/combo/demo.icon_combo.js

@ -15,6 +15,8 @@ Demo.IconCombo = BI.inherit(BI.Widget, {
type: "bi.horizontal_auto",
items: [{
type: "bi.icon_combo",
trigger: "click-hover",
container: "body",
ref:function(_ref){
self.refs=_ref;
},

43
dist/base.js vendored

@ -3008,6 +3008,19 @@ BI.Combo = BI.inherit(BI.Widget, {
e.stopPropagation();
}
};
var enterPopup = false;
function hide() {
if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid() && o.toggle === true) {
self._hideView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo);
self.fireEvent(BI.Combo.EVENT_COLLAPSE);
}
self.popupView && self.popupView.element.off("mouseenter." + self.getName()).off("mouseleave." + self.getName());
enterPopup = false;
}
BI.each(evs, function (i, ev) {
switch (ev) {
case "hover":
@ -3019,11 +3032,18 @@ BI.Combo = BI.inherit(BI.Widget, {
}
});
self.element.on("mouseleave." + self.getName(), function (e) {
if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid() && o.toggle === true) {
self._hideView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo);
self.fireEvent(BI.Combo.EVENT_COLLAPSE);
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
});
self.popupView.element.off("mouseenter." + self.getName());
});
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
});
break;
case "click":
@ -3069,11 +3089,18 @@ BI.Combo = BI.inherit(BI.Widget, {
st(e);
});
self.element.on("mouseleave." + self.getName(), function (e) {
if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid() && o.toggle === true) {
self._hideView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo);
self.fireEvent(BI.Combo.EVENT_COLLAPSE);
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
});
self.popupView.element.off("mouseenter." + self.getName());
});
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
});
break;
}

45
dist/bundle.js vendored

@ -28749,6 +28749,19 @@ BI.Combo = BI.inherit(BI.Widget, {
e.stopPropagation();
}
};
var enterPopup = false;
function hide() {
if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid() && o.toggle === true) {
self._hideView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo);
self.fireEvent(BI.Combo.EVENT_COLLAPSE);
}
self.popupView && self.popupView.element.off("mouseenter." + self.getName()).off("mouseleave." + self.getName());
enterPopup = false;
}
BI.each(evs, function (i, ev) {
switch (ev) {
case "hover":
@ -28760,11 +28773,18 @@ BI.Combo = BI.inherit(BI.Widget, {
}
});
self.element.on("mouseleave." + self.getName(), function (e) {
if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid() && o.toggle === true) {
self._hideView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo);
self.fireEvent(BI.Combo.EVENT_COLLAPSE);
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
});
self.popupView.element.off("mouseenter." + self.getName());
});
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
});
break;
case "click":
@ -28810,11 +28830,18 @@ BI.Combo = BI.inherit(BI.Widget, {
st(e);
});
self.element.on("mouseleave." + self.getName(), function (e) {
if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid() && o.toggle === true) {
self._hideView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo);
self.fireEvent(BI.Combo.EVENT_COLLAPSE);
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
});
self.popupView.element.off("mouseenter." + self.getName());
});
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
});
break;
}
@ -67626,6 +67653,8 @@ BI.IconCombo = BI.inherit(BI.Widget, {
type: "bi.combo",
element: this,
direction: o.direction,
trigger: o.trigger,
container: o.container,
adjustLength: o.adjustLength,
adjustXOffset: o.adjustXOffset,
adjustYOffset: o.adjustYOffset,

2
dist/case.js vendored

@ -5260,6 +5260,8 @@ BI.IconCombo = BI.inherit(BI.Widget, {
type: "bi.combo",
element: this,
direction: o.direction,
trigger: o.trigger,
container: o.container,
adjustLength: o.adjustLength,
adjustXOffset: o.adjustXOffset,
adjustYOffset: o.adjustYOffset,

2
dist/demo.js vendored

@ -1734,6 +1734,8 @@ Demo.IconCombo = BI.inherit(BI.Widget, {
type: "bi.horizontal_auto",
items: [{
type: "bi.icon_combo",
trigger: "click-hover",
container: "body",
ref:function(_ref){
self.refs=_ref;
},

43
src/base/combination/combo.js

@ -105,6 +105,19 @@ BI.Combo = BI.inherit(BI.Widget, {
e.stopPropagation();
}
};
var enterPopup = false;
function hide() {
if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid() && o.toggle === true) {
self._hideView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo);
self.fireEvent(BI.Combo.EVENT_COLLAPSE);
}
self.popupView && self.popupView.element.off("mouseenter." + self.getName()).off("mouseleave." + self.getName());
enterPopup = false;
}
BI.each(evs, function (i, ev) {
switch (ev) {
case "hover":
@ -116,11 +129,18 @@ BI.Combo = BI.inherit(BI.Widget, {
}
});
self.element.on("mouseleave." + self.getName(), function (e) {
if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid() && o.toggle === true) {
self._hideView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo);
self.fireEvent(BI.Combo.EVENT_COLLAPSE);
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
});
self.popupView.element.off("mouseenter." + self.getName());
});
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
});
break;
case "click":
@ -166,11 +186,18 @@ BI.Combo = BI.inherit(BI.Widget, {
st(e);
});
self.element.on("mouseleave." + self.getName(), function (e) {
if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid() && o.toggle === true) {
self._hideView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo);
self.fireEvent(BI.Combo.EVENT_COLLAPSE);
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
});
self.popupView.element.off("mouseenter." + self.getName());
});
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
});
break;
}

2
src/case/combo/iconcombo/combo.icon.js

@ -55,6 +55,8 @@ BI.IconCombo = BI.inherit(BI.Widget, {
type: "bi.combo",
element: this,
direction: o.direction,
trigger: o.trigger,
container: o.container,
adjustLength: o.adjustLength,
adjustXOffset: o.adjustXOffset,
adjustYOffset: o.adjustYOffset,

Loading…
Cancel
Save