Browse Source

Merge pull request #264 in FUI/fineui from ~WINDY/fui:master to master

* commit 'f166b2a57a12f52ef89d32ad8349249fc9af864e':
  bubble不跟随container的问题
es6
guy 7 years ago
parent
commit
7dc14ab694
  1. 1
      demo/js/base/tip/demo.bubble.js
  2. 5
      dist/base.css
  3. 5
      dist/bundle.css
  4. 28
      dist/bundle.js
  5. 2
      dist/bundle.min.css
  6. 88
      dist/bundle.min.js
  7. 28
      dist/core.js
  8. 1
      dist/demo.js
  9. 5
      dist/fineui.css
  10. 28
      dist/fineui.js
  11. 2
      dist/fineui.min.css
  12. 88
      dist/fineui.min.js
  13. 28
      src/core/controller/controller.bubbles.js
  14. 5
      src/css/base/single/tip/tip.css
  15. 2
      src/less/base/single/tip/tip.less
  16. 1
      src/less/base/single/tip/tip.toast.less
  17. 1
      src/less/base/single/tip/tip.tooltip.less

1
demo/js/base/tip/demo.bubble.js

@ -12,6 +12,7 @@ Demo.Bubble = BI.inherit(BI.Widget, {
},
type: "bi.button",
text: "bubble测试(消息)",
title: "123",
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble1", "bubble测试", this, {

5
dist/base.css vendored

@ -1539,11 +1539,9 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
color: #faaa39;
}
.bi-tip {
position: fixed !important;
}
.bi-toast {
position: fixed !important;
font-size: 14px;
color: #ffffff;
max-width: 400px;
@ -1569,6 +1567,7 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
}
.bi-tooltip {
position: fixed !important;
max-width: 250px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;

5
dist/bundle.css vendored

@ -3586,11 +3586,9 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
color: #faaa39;
}
.bi-tip {
position: fixed !important;
}
.bi-toast {
position: fixed !important;
font-size: 14px;
color: #ffffff;
max-width: 400px;
@ -3616,6 +3614,7 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
}
.bi-tooltip {
position: fixed !important;
max-width: 250px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;

28
dist/bundle.js vendored

@ -18231,16 +18231,8 @@ BI.BubblesController = BI.inherit(BI.Controller, {
_init: function () {
BI.BubblesController.superclass._init.apply(this, arguments);
var self = this;
this.bubblesManager = {};
this.storeBubbles = {};
BI.Resizers.add("bubbleController" + BI.uniqueId(), function () {
BI.each(self.bubblesManager, function (name) {
self.remove(name);
});
self.bubblesManager = {};
self.storeBubbles = {};
});
},
_createBubble: function (direct, text, level, height) {
@ -18256,60 +18248,60 @@ BI.BubblesController = BI.inherit(BI.Controller, {
_getOffsetLeft: function (name, context, offsetStyle) {
var left = 0;
if ("center" === offsetStyle) {
left = context.element.offset().left + (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
left = (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
if (left < 0) {
left = 0;
}
return left;
}
if ("right" === offsetStyle) {
left = context.element.offset().left + context.element.bounds().width - this.get(name).element.bounds().width;
left = context.element.bounds().width - this.get(name).element.bounds().width;
if (left < 0) {
left = 0;
}
return left;
}
return context.element.offset().left;
return left;
},
_getOffsetTop: function (name, context, offsetStyle) {
var top = 0;
if ("center" === offsetStyle) {
top = context.element.offset().top + (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
top = (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
if (top < 0) {
top = 0;
}
return top;
} else if ("right" === offsetStyle) {
top = context.element.offset().top + context.element.bounds().height - this.get(name).element.bounds().height;
top = context.element.bounds().height - this.get(name).element.bounds().height;
if (top < 0) {
top = 0;
}
return top;
}
return context.element.offset().top;
return top;
},
_getLeftPosition: function (name, context, offsetStyle) {
var position = $.getLeftPosition(context, this.get(name));
var position = {left: - this.get(name).element.bounds().width};
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},
_getBottomPosition: function (name, context, offsetStyle) {
var position = $.getBottomPosition(context, this.get(name));
var position = {top: context.element.bounds().height};
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getTopPosition: function (name, context, offsetStyle) {
var position = $.getTopPosition(context, this.get(name));
var position = {top: -35};
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getRightPosition: function (name, context, offsetStyle) {
var position = $.getRightPosition(context, this.get(name));
var position = {left: context.element.bounds().width};
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

88
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

28
dist/core.js vendored

@ -18231,16 +18231,8 @@ BI.BubblesController = BI.inherit(BI.Controller, {
_init: function () {
BI.BubblesController.superclass._init.apply(this, arguments);
var self = this;
this.bubblesManager = {};
this.storeBubbles = {};
BI.Resizers.add("bubbleController" + BI.uniqueId(), function () {
BI.each(self.bubblesManager, function (name) {
self.remove(name);
});
self.bubblesManager = {};
self.storeBubbles = {};
});
},
_createBubble: function (direct, text, level, height) {
@ -18256,60 +18248,60 @@ BI.BubblesController = BI.inherit(BI.Controller, {
_getOffsetLeft: function (name, context, offsetStyle) {
var left = 0;
if ("center" === offsetStyle) {
left = context.element.offset().left + (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
left = (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
if (left < 0) {
left = 0;
}
return left;
}
if ("right" === offsetStyle) {
left = context.element.offset().left + context.element.bounds().width - this.get(name).element.bounds().width;
left = context.element.bounds().width - this.get(name).element.bounds().width;
if (left < 0) {
left = 0;
}
return left;
}
return context.element.offset().left;
return left;
},
_getOffsetTop: function (name, context, offsetStyle) {
var top = 0;
if ("center" === offsetStyle) {
top = context.element.offset().top + (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
top = (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
if (top < 0) {
top = 0;
}
return top;
} else if ("right" === offsetStyle) {
top = context.element.offset().top + context.element.bounds().height - this.get(name).element.bounds().height;
top = context.element.bounds().height - this.get(name).element.bounds().height;
if (top < 0) {
top = 0;
}
return top;
}
return context.element.offset().top;
return top;
},
_getLeftPosition: function (name, context, offsetStyle) {
var position = $.getLeftPosition(context, this.get(name));
var position = {left: - this.get(name).element.bounds().width};
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},
_getBottomPosition: function (name, context, offsetStyle) {
var position = $.getBottomPosition(context, this.get(name));
var position = {top: context.element.bounds().height};
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getTopPosition: function (name, context, offsetStyle) {
var position = $.getTopPosition(context, this.get(name));
var position = {top: -35};
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getRightPosition: function (name, context, offsetStyle) {
var position = $.getRightPosition(context, this.get(name));
var position = {left: context.element.bounds().width};
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},

1
dist/demo.js vendored

@ -1495,6 +1495,7 @@ BI.shortcut("demo.table_view", Demo.Func);Demo.Bubble = BI.inherit(BI.Widget, {
},
type: "bi.button",
text: "bubble测试(消息)",
title: "123",
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble1", "bubble测试", this, {

5
dist/fineui.css vendored

@ -3586,11 +3586,9 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
color: #faaa39;
}
.bi-tip {
position: fixed !important;
}
.bi-toast {
position: fixed !important;
font-size: 14px;
color: #ffffff;
max-width: 400px;
@ -3616,6 +3614,7 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
}
.bi-tooltip {
position: fixed !important;
max-width: 250px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;

28
dist/fineui.js vendored

@ -18432,16 +18432,8 @@ BI.BubblesController = BI.inherit(BI.Controller, {
_init: function () {
BI.BubblesController.superclass._init.apply(this, arguments);
var self = this;
this.bubblesManager = {};
this.storeBubbles = {};
BI.Resizers.add("bubbleController" + BI.uniqueId(), function () {
BI.each(self.bubblesManager, function (name) {
self.remove(name);
});
self.bubblesManager = {};
self.storeBubbles = {};
});
},
_createBubble: function (direct, text, level, height) {
@ -18457,60 +18449,60 @@ BI.BubblesController = BI.inherit(BI.Controller, {
_getOffsetLeft: function (name, context, offsetStyle) {
var left = 0;
if ("center" === offsetStyle) {
left = context.element.offset().left + (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
left = (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
if (left < 0) {
left = 0;
}
return left;
}
if ("right" === offsetStyle) {
left = context.element.offset().left + context.element.bounds().width - this.get(name).element.bounds().width;
left = context.element.bounds().width - this.get(name).element.bounds().width;
if (left < 0) {
left = 0;
}
return left;
}
return context.element.offset().left;
return left;
},
_getOffsetTop: function (name, context, offsetStyle) {
var top = 0;
if ("center" === offsetStyle) {
top = context.element.offset().top + (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
top = (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
if (top < 0) {
top = 0;
}
return top;
} else if ("right" === offsetStyle) {
top = context.element.offset().top + context.element.bounds().height - this.get(name).element.bounds().height;
top = context.element.bounds().height - this.get(name).element.bounds().height;
if (top < 0) {
top = 0;
}
return top;
}
return context.element.offset().top;
return top;
},
_getLeftPosition: function (name, context, offsetStyle) {
var position = $.getLeftPosition(context, this.get(name));
var position = {left: - this.get(name).element.bounds().width};
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},
_getBottomPosition: function (name, context, offsetStyle) {
var position = $.getBottomPosition(context, this.get(name));
var position = {top: context.element.bounds().height};
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getTopPosition: function (name, context, offsetStyle) {
var position = $.getTopPosition(context, this.get(name));
var position = {top: -35};
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getRightPosition: function (name, context, offsetStyle) {
var position = $.getRightPosition(context, this.get(name));
var position = {left: context.element.bounds().width};
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},

2
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

88
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

28
src/core/controller/controller.bubbles.js

@ -16,16 +16,8 @@ BI.BubblesController = BI.inherit(BI.Controller, {
_init: function () {
BI.BubblesController.superclass._init.apply(this, arguments);
var self = this;
this.bubblesManager = {};
this.storeBubbles = {};
BI.Resizers.add("bubbleController" + BI.uniqueId(), function () {
BI.each(self.bubblesManager, function (name) {
self.remove(name);
});
self.bubblesManager = {};
self.storeBubbles = {};
});
},
_createBubble: function (direct, text, level, height) {
@ -41,60 +33,60 @@ BI.BubblesController = BI.inherit(BI.Controller, {
_getOffsetLeft: function (name, context, offsetStyle) {
var left = 0;
if ("center" === offsetStyle) {
left = context.element.offset().left + (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
left = (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
if (left < 0) {
left = 0;
}
return left;
}
if ("right" === offsetStyle) {
left = context.element.offset().left + context.element.bounds().width - this.get(name).element.bounds().width;
left = context.element.bounds().width - this.get(name).element.bounds().width;
if (left < 0) {
left = 0;
}
return left;
}
return context.element.offset().left;
return left;
},
_getOffsetTop: function (name, context, offsetStyle) {
var top = 0;
if ("center" === offsetStyle) {
top = context.element.offset().top + (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
top = (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
if (top < 0) {
top = 0;
}
return top;
} else if ("right" === offsetStyle) {
top = context.element.offset().top + context.element.bounds().height - this.get(name).element.bounds().height;
top = context.element.bounds().height - this.get(name).element.bounds().height;
if (top < 0) {
top = 0;
}
return top;
}
return context.element.offset().top;
return top;
},
_getLeftPosition: function (name, context, offsetStyle) {
var position = $.getLeftPosition(context, this.get(name));
var position = {left: - this.get(name).element.bounds().width};
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},
_getBottomPosition: function (name, context, offsetStyle) {
var position = $.getBottomPosition(context, this.get(name));
var position = {top: context.element.bounds().height};
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getTopPosition: function (name, context, offsetStyle) {
var position = $.getTopPosition(context, this.get(name));
var position = {top: -35};
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getRightPosition: function (name, context, offsetStyle) {
var position = $.getRightPosition(context, this.get(name));
var position = {left: context.element.bounds().width};
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},

5
src/css/base/single/tip/tip.css

@ -23,11 +23,9 @@
color: #faaa39;
}
.bi-tip {
position: fixed !important;
}
.bi-toast {
position: fixed !important;
font-size: 14px;
color: #ffffff;
max-width: 400px;
@ -53,6 +51,7 @@
}
.bi-tooltip {
position: fixed !important;
max-width: 250px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;

2
src/less/base/single/tip/tip.less

@ -2,5 +2,5 @@
.bi-tip{
position: fixed !important;
}

1
src/less/base/single/tip/tip.toast.less

@ -1,6 +1,7 @@
@import "../../../index";
.bi-toast{
position: fixed !important;
font-size: @font-size-14;
color: @color-bi-text;
max-width: 400px;

1
src/less/base/single/tip/tip.tooltip.less

@ -1,6 +1,7 @@
@import "../../../index";
.bi-tooltip{
position: fixed !important;
max-width: 250px;
.border-radius(2px);
font-size: 12px;

Loading…
Cancel
Save