Browse Source

Merge pull request #180 in FUI/fineui from ~GUY/fineui:master to master

* commit 'b7f1b402dcda3cb0b8ddae263d68891c60a04358':
  update
  update
  BI-10839 combo
  滑块问题
es6
guy 7 years ago
parent
commit
851f50f2e4
  1. 47
      bi/base.js
  2. 2
      bi/case.js
  3. 14
      bi/core.js
  4. 10
      bi/widget.js
  5. 2
      demo/js/case/combo/demo.icon_combo.js
  6. 47
      dist/base.js
  7. 73
      dist/bundle.js
  8. 58
      dist/bundle.min.js
  9. 2
      dist/case.js
  10. 14
      dist/core.js
  11. 2
      dist/demo.js
  12. 10
      dist/widget.js
  13. 47
      src/base/combination/combo.js
  14. 2
      src/case/combo/iconcombo/combo.icon.js
  15. 14
      src/core/base.js
  16. 2
      src/widget/intervalslider/intervalslider.js
  17. 2
      src/widget/intervalslider/intervalslider.label.js
  18. 2
      src/widget/singleslider/singleslider.js
  19. 2
      src/widget/singleslider/singleslider.label.js
  20. 2
      src/widget/singleslider/singleslider.normal.js

47
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,

14
bi/core.js

@ -12195,10 +12195,16 @@ if (!window.BI) {
//浏览器相关方法
_.extend(BI, {
isIE: function () {
return /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
if (this.__isIE == null) {
this.__isIE = /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
}
return this.__isIE;
},
getIEVersion: function () {
if (this.__IEVersion != null) {
return this.__IEVersion;
}
var version = 0;
var agent = navigator.userAgent.toLowerCase();
var v1 = agent.match(/(?:msie\s([\w.]+))/);
@ -12212,7 +12218,7 @@ if (!window.BI) {
} else {
version = 0;
}
return version;
return this.__IEVersion = version;
},
isIE9Below: function () {
@ -12222,10 +12228,6 @@ if (!window.BI) {
return this.getIEVersion() < 9;
},
isIE9: function () {
return this.getIEVersion() === 9;
},
isEdge: function () {
return /edge/i.test(navigator.userAgent.toLowerCase());
},

10
bi/widget.js

@ -5800,7 +5800,7 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
});
function optimizeSize(s) {
return BI.clamp(s, 0, o.width);
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},
@ -6261,7 +6261,7 @@ BI.IntervalSliderLabel = BI.inherit(BI.Widget, {
});
function optimizeSize(s) {
return BI.clamp(s, 0, o.width);
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},
@ -17458,7 +17458,7 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
});
function optimizeSize(s) {
return BI.clamp(s, 0, o.width);
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},
@ -17759,7 +17759,7 @@ BI.SingleSliderLabel = BI.inherit(BI.Widget, {
});
function optimizeSize(s) {
return BI.clamp(s, 0, o.width);
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},
@ -18024,7 +18024,7 @@ BI.SingleSliderNormal = BI.inherit(BI.Widget, {
});
function optimizeSize(s) {
return BI.clamp(s, 0, o.width);
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},

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;
},

47
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;
}

73
dist/bundle.js vendored

@ -12195,10 +12195,16 @@ if (!window.BI) {
//浏览器相关方法
_.extend(BI, {
isIE: function () {
return /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
if (this.__isIE == null) {
this.__isIE = /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
}
return this.__isIE;
},
getIEVersion: function () {
if (this.__IEVersion != null) {
return this.__IEVersion;
}
var version = 0;
var agent = navigator.userAgent.toLowerCase();
var v1 = agent.match(/(?:msie\s([\w.]+))/);
@ -12212,7 +12218,7 @@ if (!window.BI) {
} else {
version = 0;
}
return version;
return this.__IEVersion = version;
},
isIE9Below: function () {
@ -12222,10 +12228,6 @@ if (!window.BI) {
return this.getIEVersion() < 9;
},
isIE9: function () {
return this.getIEVersion() === 9;
},
isEdge: function () {
return /edge/i.test(navigator.userAgent.toLowerCase());
},
@ -28749,6 +28751,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 +28775,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 +28832,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 +67655,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,
@ -80815,7 +80846,7 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
});
function optimizeSize(s) {
return BI.clamp(s, 0, o.width);
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},
@ -81276,7 +81307,7 @@ BI.IntervalSliderLabel = BI.inherit(BI.Widget, {
});
function optimizeSize(s) {
return BI.clamp(s, 0, o.width);
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},
@ -92473,7 +92504,7 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
});
function optimizeSize(s) {
return BI.clamp(s, 0, o.width);
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},
@ -92774,7 +92805,7 @@ BI.SingleSliderLabel = BI.inherit(BI.Widget, {
});
function optimizeSize(s) {
return BI.clamp(s, 0, o.width);
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},
@ -93039,7 +93070,7 @@ BI.SingleSliderNormal = BI.inherit(BI.Widget, {
});
function optimizeSize(s) {
return BI.clamp(s, 0, o.width);
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},

58
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

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,

14
dist/core.js vendored

@ -12195,10 +12195,16 @@ if (!window.BI) {
//浏览器相关方法
_.extend(BI, {
isIE: function () {
return /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
if (this.__isIE == null) {
this.__isIE = /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
}
return this.__isIE;
},
getIEVersion: function () {
if (this.__IEVersion != null) {
return this.__IEVersion;
}
var version = 0;
var agent = navigator.userAgent.toLowerCase();
var v1 = agent.match(/(?:msie\s([\w.]+))/);
@ -12212,7 +12218,7 @@ if (!window.BI) {
} else {
version = 0;
}
return version;
return this.__IEVersion = version;
},
isIE9Below: function () {
@ -12222,10 +12228,6 @@ if (!window.BI) {
return this.getIEVersion() < 9;
},
isIE9: function () {
return this.getIEVersion() === 9;
},
isEdge: function () {
return /edge/i.test(navigator.userAgent.toLowerCase());
},

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;
},

10
dist/widget.js vendored

@ -5800,7 +5800,7 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
});
function optimizeSize(s) {
return BI.clamp(s, 0, o.width);
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},
@ -6261,7 +6261,7 @@ BI.IntervalSliderLabel = BI.inherit(BI.Widget, {
});
function optimizeSize(s) {
return BI.clamp(s, 0, o.width);
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},
@ -17458,7 +17458,7 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
});
function optimizeSize(s) {
return BI.clamp(s, 0, o.width);
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},
@ -17759,7 +17759,7 @@ BI.SingleSliderLabel = BI.inherit(BI.Widget, {
});
function optimizeSize(s) {
return BI.clamp(s, 0, o.width);
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},
@ -18024,7 +18024,7 @@ BI.SingleSliderNormal = BI.inherit(BI.Widget, {
});
function optimizeSize(s) {
return BI.clamp(s, 0, o.width);
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},

47
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,

14
src/core/base.js

@ -1045,10 +1045,16 @@ if (!window.BI) {
//浏览器相关方法
_.extend(BI, {
isIE: function () {
return /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
if (this.__isIE == null) {
this.__isIE = /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
}
return this.__isIE;
},
getIEVersion: function () {
if (this.__IEVersion != null) {
return this.__IEVersion;
}
var version = 0;
var agent = navigator.userAgent.toLowerCase();
var v1 = agent.match(/(?:msie\s([\w.]+))/);
@ -1062,7 +1068,7 @@ if (!window.BI) {
} else {
version = 0;
}
return version;
return this.__IEVersion = version;
},
isIE9Below: function () {
@ -1072,10 +1078,6 @@ if (!window.BI) {
return this.getIEVersion() < 9;
},
isIE9: function () {
return this.getIEVersion() === 9;
},
isEdge: function () {
return /edge/i.test(navigator.userAgent.toLowerCase());
},

2
src/widget/intervalslider/intervalslider.js

@ -194,7 +194,7 @@ BI.IntervalSlider = BI.inherit(BI.Widget, {
});
function optimizeSize(s) {
return BI.clamp(s, 0, o.width);
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},

2
src/widget/intervalslider/intervalslider.label.js

@ -157,7 +157,7 @@ BI.IntervalSliderLabel = BI.inherit(BI.Widget, {
});
function optimizeSize(s) {
return BI.clamp(s, 0, o.width);
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},

2
src/widget/singleslider/singleslider.js

@ -188,7 +188,7 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
});
function optimizeSize(s) {
return BI.clamp(s, 0, o.width);
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},

2
src/widget/singleslider/singleslider.label.js

@ -169,7 +169,7 @@ BI.SingleSliderLabel = BI.inherit(BI.Widget, {
});
function optimizeSize(s) {
return BI.clamp(s, 0, o.width);
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},

2
src/widget/singleslider/singleslider.normal.js

@ -134,7 +134,7 @@ BI.SingleSliderNormal = BI.inherit(BI.Widget, {
});
function optimizeSize(s) {
return BI.clamp(s, 0, o.width);
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},

Loading…
Cancel
Save