Browse Source

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

* commit 'afe59662c7a8b1d009d2526ee44ddb04b49ad571':
  update
  update
  update
  tooltip
es6
guy 7 years ago
parent
commit
bd59dddc33
  1. 16
      bi/core.js
  2. 16
      dist/bundle.js
  3. 32
      dist/bundle.min.js
  4. 16
      dist/core.js
  5. 3
      dist/fix/fix.js
  6. 4
      dist/resource.css
  7. 16
      src/core/controller/controller.tooltips.js
  8. 4
      src/css/resource/font.css
  9. 7
      src/less/resource/font.less

16
bi/core.js

@ -18759,13 +18759,14 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
if (!this.has(name)) { if (!this.has(name)) {
this.create(name, text, level, opt.container || context); this.create(name, text, level, opt.container || context);
} }
if (!opt.belowMouse) {
var offset = context.element.offset(); var offset = context.element.offset();
var bounds = context.element.bounds(); var bounds = context.element.bounds();
if(bounds.height === 0 || bounds.width === 0) { if (bounds.height === 0 || bounds.width === 0) {
return; return;
}
var top = offset.top + bounds.height + 5;
} }
var top = offset.top + bounds.height + 5;
var tooltip = this.get(name); var tooltip = this.get(name);
tooltip.setText(text); tooltip.setText(text);
tooltip.element.css({ tooltip.element.css({
@ -18781,8 +18782,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
} }
if (y + tooltip.element.outerHeight() > $("body").outerHeight()) { if (y + tooltip.element.outerHeight() > $("body").outerHeight()) {
y -= tooltip.element.outerHeight() + 15; y -= tooltip.element.outerHeight() + 15;
top = offset.top - tooltip.element.outerHeight() - 5; !opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
!opt.belowMouse && (y = Math.min(y, top));
} else { } else {
!opt.belowMouse && (y = Math.max(y, top)); !opt.belowMouse && (y = Math.max(y, top));
} }

16
dist/bundle.js vendored

@ -18759,13 +18759,14 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
if (!this.has(name)) { if (!this.has(name)) {
this.create(name, text, level, opt.container || context); this.create(name, text, level, opt.container || context);
} }
if (!opt.belowMouse) {
var offset = context.element.offset(); var offset = context.element.offset();
var bounds = context.element.bounds(); var bounds = context.element.bounds();
if(bounds.height === 0 || bounds.width === 0) { if (bounds.height === 0 || bounds.width === 0) {
return; return;
}
var top = offset.top + bounds.height + 5;
} }
var top = offset.top + bounds.height + 5;
var tooltip = this.get(name); var tooltip = this.get(name);
tooltip.setText(text); tooltip.setText(text);
tooltip.element.css({ tooltip.element.css({
@ -18781,8 +18782,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
} }
if (y + tooltip.element.outerHeight() > $("body").outerHeight()) { if (y + tooltip.element.outerHeight() > $("body").outerHeight()) {
y -= tooltip.element.outerHeight() + 15; y -= tooltip.element.outerHeight() + 15;
top = offset.top - tooltip.element.outerHeight() - 5; !opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
!opt.belowMouse && (y = Math.min(y, top));
} else { } else {
!opt.belowMouse && (y = Math.max(y, top)); !opt.belowMouse && (y = Math.max(y, top));
} }

32
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

16
dist/core.js vendored

@ -18759,13 +18759,14 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
if (!this.has(name)) { if (!this.has(name)) {
this.create(name, text, level, opt.container || context); this.create(name, text, level, opt.container || context);
} }
if (!opt.belowMouse) {
var offset = context.element.offset(); var offset = context.element.offset();
var bounds = context.element.bounds(); var bounds = context.element.bounds();
if(bounds.height === 0 || bounds.width === 0) { if (bounds.height === 0 || bounds.width === 0) {
return; return;
}
var top = offset.top + bounds.height + 5;
} }
var top = offset.top + bounds.height + 5;
var tooltip = this.get(name); var tooltip = this.get(name);
tooltip.setText(text); tooltip.setText(text);
tooltip.element.css({ tooltip.element.css({
@ -18781,8 +18782,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
} }
if (y + tooltip.element.outerHeight() > $("body").outerHeight()) { if (y + tooltip.element.outerHeight() > $("body").outerHeight()) {
y -= tooltip.element.outerHeight() + 15; y -= tooltip.element.outerHeight() + 15;
top = offset.top - tooltip.element.outerHeight() - 5; !opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
!opt.belowMouse && (y = Math.min(y, top));
} else { } else {
!opt.belowMouse && (y = Math.max(y, top)); !opt.belowMouse && (y = Math.max(y, top));
} }

3
dist/fix/fix.js vendored

@ -400,7 +400,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
Observer.prototype.observeArray = function observeArray(items) { Observer.prototype.observeArray = function observeArray(items) {
for (var i = 0, l = items.length; i < l; i++) { for (var i = 0, l = items.length; i < l; i++) {
items[i] = observe(items[i], this, i).model; var ob = observe(items[i], this, i);
items[i] = ob ? ob.model : items[i];
} }
return items; return items;
}; };

4
dist/resource.css vendored

@ -333,10 +333,6 @@ textarea::-webkit-scrollbar-thumb:hover {
/* iOS 4.1- */ /* iOS 4.1- */
} }
@font-face {
font-family: 'bi';
src: url('font/iconfont.eot') /* IE6-IE8 */;
}
.b-font { .b-font {
font-family: "bi"; font-family: "bi";
font-style: normal; font-style: normal;

16
src/core/controller/controller.tooltips.js

@ -68,13 +68,14 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
if (!this.has(name)) { if (!this.has(name)) {
this.create(name, text, level, opt.container || context); this.create(name, text, level, opt.container || context);
} }
if (!opt.belowMouse) {
var offset = context.element.offset(); var offset = context.element.offset();
var bounds = context.element.bounds(); var bounds = context.element.bounds();
if(bounds.height === 0 || bounds.width === 0) { if (bounds.height === 0 || bounds.width === 0) {
return; return;
}
var top = offset.top + bounds.height + 5;
} }
var top = offset.top + bounds.height + 5;
var tooltip = this.get(name); var tooltip = this.get(name);
tooltip.setText(text); tooltip.setText(text);
tooltip.element.css({ tooltip.element.css({
@ -90,8 +91,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
} }
if (y + tooltip.element.outerHeight() > $("body").outerHeight()) { if (y + tooltip.element.outerHeight() > $("body").outerHeight()) {
y -= tooltip.element.outerHeight() + 15; y -= tooltip.element.outerHeight() + 15;
top = offset.top - tooltip.element.outerHeight() - 5; !opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
!opt.belowMouse && (y = Math.min(y, top));
} else { } else {
!opt.belowMouse && (y = Math.max(y, top)); !opt.belowMouse && (y = Math.max(y, top));
} }

4
src/css/resource/font.css

@ -4,10 +4,6 @@
/* iOS 4.1- */ /* iOS 4.1- */
} }
@font-face {
font-family: 'bi';
src: url('font/iconfont.eot') /* IE6-IE8 */;
}
.b-font { .b-font {
font-family: "bi"; font-family: "bi";
font-style: normal; font-style: normal;

7
src/less/resource/font.less

@ -7,13 +7,6 @@
src: url('@{fontUrl}iconfont.eot'), /* IE6-IE8 */ url('@{fontUrl}iconfont.woff') format('woff'), /* chrome、firefox */ url('@{fontUrl}iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('@{fontUrl}iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */ src: url('@{fontUrl}iconfont.eot'), /* IE6-IE8 */ url('@{fontUrl}iconfont.woff') format('woff'), /* chrome、firefox */ url('@{fontUrl}iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('@{fontUrl}iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */
} }
html.ie9below {
@font-face {
font-family: 'bi';
src: url('@{fontUrl}iconfont.eot') /* IE6-IE8 */
}
}
.b-font { .b-font {
font-family: "bi"; font-family: "bi";
font-style: normal; font-style: normal;

Loading…
Cancel
Save