Browse Source

无JIRA任务 textAlign: center的label换行左对齐

es6
windy 6 years ago
parent
commit
0193d84c2b
  1. 14
      dist/base.js
  2. 16
      dist/bundle.ie.js
  3. 34
      dist/bundle.ie.min.js
  4. 16
      dist/bundle.js
  5. 72
      dist/bundle.min.js
  6. 2
      dist/core.js
  7. 16
      dist/fineui.ie.js
  8. 34
      dist/fineui.ie.min.js
  9. 16
      dist/fineui.js
  10. 72
      dist/fineui.min.js
  11. 16
      dist/fineui_without_jquery_polyfill.js
  12. 2
      dist/utils.min.js
  13. 14
      src/base/single/label/label.js
  14. 2
      src/core/controller/controller.tooltips.js

14
dist/base.js vendored

@ -10788,7 +10788,6 @@ BI.Label = BI.inherit(BI.Single, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
wrapAlign: "center", // 换行之后的文本的文本是都需要居中对齐,在textAlign为center时生效
forceCenter: false, // 是否无论如何都要居中, 不考虑超出边界的情况, 在未知宽度和高度时有效
textWidth: null,
textHeight: null,
@ -10806,7 +10805,7 @@ BI.Label = BI.inherit(BI.Single, {
_createJson: function () {
var o = this.options;
var obj = {
return {
type: "bi.text",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
@ -10816,10 +10815,6 @@ BI.Label = BI.inherit(BI.Single, {
py: o.py,
keyword: o.keyword
};
if(o.textAlign === "center") {
obj.textAlign = o.wrapAlign;
}
return obj;
},
_init: function () {
@ -10835,6 +10830,7 @@ BI.Label = BI.inherit(BI.Single, {
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
if (BI.isNumber(o.height) && o.height > 0) {
@ -10858,6 +10854,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.textWidth;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -10905,6 +10902,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -10976,6 +10974,8 @@ BI.Label = BI.inherit(BI.Single, {
this.element.css({
"line-height": o.height + "px"
});
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));
@ -11003,6 +11003,8 @@ BI.Label = BI.inherit(BI.Single, {
});
return;
}
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));

16
dist/bundle.ie.js vendored

@ -17257,7 +17257,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
x -= tooltip.element.outerWidth() + 15;
}
var bodyHeight = BI.Widget._renderEngine.createElement("body").outerHeight();
if (y + tooltip.element.outerHeight() > bodyHeight || (!opt.belowMouse && top + tooltip.element.outerHeight() > bodyHeight)) {
if (y + tooltip.element.outerHeight() > bodyHeight || top + tooltip.element.outerHeight() > bodyHeight) {
y -= tooltip.element.outerHeight() + 15;
!opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
} else {
@ -45884,7 +45884,6 @@ BI.Label = BI.inherit(BI.Single, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
wrapAlign: "center", // 换行之后的文本的文本是都需要居中对齐,在textAlign为center时生效
forceCenter: false, // 是否无论如何都要居中, 不考虑超出边界的情况, 在未知宽度和高度时有效
textWidth: null,
textHeight: null,
@ -45902,7 +45901,7 @@ BI.Label = BI.inherit(BI.Single, {
_createJson: function () {
var o = this.options;
var obj = {
return {
type: "bi.text",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
@ -45912,10 +45911,6 @@ BI.Label = BI.inherit(BI.Single, {
py: o.py,
keyword: o.keyword
};
if(o.textAlign === "center") {
obj.textAlign = o.wrapAlign;
}
return obj;
},
_init: function () {
@ -45931,6 +45926,7 @@ BI.Label = BI.inherit(BI.Single, {
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
if (BI.isNumber(o.height) && o.height > 0) {
@ -45954,6 +45950,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.textWidth;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -46001,6 +45998,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -46072,6 +46070,8 @@ BI.Label = BI.inherit(BI.Single, {
this.element.css({
"line-height": o.height + "px"
});
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));
@ -46099,6 +46099,8 @@ BI.Label = BI.inherit(BI.Single, {
});
return;
}
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));

34
dist/bundle.ie.min.js vendored

File diff suppressed because one or more lines are too long

16
dist/bundle.js vendored

@ -17257,7 +17257,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
x -= tooltip.element.outerWidth() + 15;
}
var bodyHeight = BI.Widget._renderEngine.createElement("body").outerHeight();
if (y + tooltip.element.outerHeight() > bodyHeight || (!opt.belowMouse && top + tooltip.element.outerHeight() > bodyHeight)) {
if (y + tooltip.element.outerHeight() > bodyHeight || top + tooltip.element.outerHeight() > bodyHeight) {
y -= tooltip.element.outerHeight() + 15;
!opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
} else {
@ -46288,7 +46288,6 @@ BI.Label = BI.inherit(BI.Single, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
wrapAlign: "center", // 换行之后的文本的文本是都需要居中对齐,在textAlign为center时生效
forceCenter: false, // 是否无论如何都要居中, 不考虑超出边界的情况, 在未知宽度和高度时有效
textWidth: null,
textHeight: null,
@ -46306,7 +46305,7 @@ BI.Label = BI.inherit(BI.Single, {
_createJson: function () {
var o = this.options;
var obj = {
return {
type: "bi.text",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
@ -46316,10 +46315,6 @@ BI.Label = BI.inherit(BI.Single, {
py: o.py,
keyword: o.keyword
};
if(o.textAlign === "center") {
obj.textAlign = o.wrapAlign;
}
return obj;
},
_init: function () {
@ -46335,6 +46330,7 @@ BI.Label = BI.inherit(BI.Single, {
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
if (BI.isNumber(o.height) && o.height > 0) {
@ -46358,6 +46354,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.textWidth;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -46405,6 +46402,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -46476,6 +46474,8 @@ BI.Label = BI.inherit(BI.Single, {
this.element.css({
"line-height": o.height + "px"
});
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));
@ -46503,6 +46503,8 @@ BI.Label = BI.inherit(BI.Single, {
});
return;
}
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));

72
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/core.js vendored

@ -17257,7 +17257,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
x -= tooltip.element.outerWidth() + 15;
}
var bodyHeight = BI.Widget._renderEngine.createElement("body").outerHeight();
if (y + tooltip.element.outerHeight() > bodyHeight || (!opt.belowMouse && top + tooltip.element.outerHeight() > bodyHeight)) {
if (y + tooltip.element.outerHeight() > bodyHeight || top + tooltip.element.outerHeight() > bodyHeight) {
y -= tooltip.element.outerHeight() + 15;
!opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
} else {

16
dist/fineui.ie.js vendored

@ -17502,7 +17502,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
x -= tooltip.element.outerWidth() + 15;
}
var bodyHeight = BI.Widget._renderEngine.createElement("body").outerHeight();
if (y + tooltip.element.outerHeight() > bodyHeight || (!opt.belowMouse && top + tooltip.element.outerHeight() > bodyHeight)) {
if (y + tooltip.element.outerHeight() > bodyHeight || top + tooltip.element.outerHeight() > bodyHeight) {
y -= tooltip.element.outerHeight() + 15;
!opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
} else {
@ -46129,7 +46129,6 @@ BI.Label = BI.inherit(BI.Single, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
wrapAlign: "center", // 换行之后的文本的文本是都需要居中对齐,在textAlign为center时生效
forceCenter: false, // 是否无论如何都要居中, 不考虑超出边界的情况, 在未知宽度和高度时有效
textWidth: null,
textHeight: null,
@ -46147,7 +46146,7 @@ BI.Label = BI.inherit(BI.Single, {
_createJson: function () {
var o = this.options;
var obj = {
return {
type: "bi.text",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
@ -46157,10 +46156,6 @@ BI.Label = BI.inherit(BI.Single, {
py: o.py,
keyword: o.keyword
};
if(o.textAlign === "center") {
obj.textAlign = o.wrapAlign;
}
return obj;
},
_init: function () {
@ -46176,6 +46171,7 @@ BI.Label = BI.inherit(BI.Single, {
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
if (BI.isNumber(o.height) && o.height > 0) {
@ -46199,6 +46195,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.textWidth;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -46246,6 +46243,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -46317,6 +46315,8 @@ BI.Label = BI.inherit(BI.Single, {
this.element.css({
"line-height": o.height + "px"
});
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));
@ -46344,6 +46344,8 @@ BI.Label = BI.inherit(BI.Single, {
});
return;
}
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));

34
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

16
dist/fineui.js vendored

@ -17502,7 +17502,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
x -= tooltip.element.outerWidth() + 15;
}
var bodyHeight = BI.Widget._renderEngine.createElement("body").outerHeight();
if (y + tooltip.element.outerHeight() > bodyHeight || (!opt.belowMouse && top + tooltip.element.outerHeight() > bodyHeight)) {
if (y + tooltip.element.outerHeight() > bodyHeight || top + tooltip.element.outerHeight() > bodyHeight) {
y -= tooltip.element.outerHeight() + 15;
!opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
} else {
@ -46533,7 +46533,6 @@ BI.Label = BI.inherit(BI.Single, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
wrapAlign: "center", // 换行之后的文本的文本是都需要居中对齐,在textAlign为center时生效
forceCenter: false, // 是否无论如何都要居中, 不考虑超出边界的情况, 在未知宽度和高度时有效
textWidth: null,
textHeight: null,
@ -46551,7 +46550,7 @@ BI.Label = BI.inherit(BI.Single, {
_createJson: function () {
var o = this.options;
var obj = {
return {
type: "bi.text",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
@ -46561,10 +46560,6 @@ BI.Label = BI.inherit(BI.Single, {
py: o.py,
keyword: o.keyword
};
if(o.textAlign === "center") {
obj.textAlign = o.wrapAlign;
}
return obj;
},
_init: function () {
@ -46580,6 +46575,7 @@ BI.Label = BI.inherit(BI.Single, {
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
if (BI.isNumber(o.height) && o.height > 0) {
@ -46603,6 +46599,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.textWidth;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -46650,6 +46647,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -46721,6 +46719,8 @@ BI.Label = BI.inherit(BI.Single, {
this.element.css({
"line-height": o.height + "px"
});
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));
@ -46748,6 +46748,8 @@ BI.Label = BI.inherit(BI.Single, {
});
return;
}
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));

72
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

16
dist/fineui_without_jquery_polyfill.js vendored

@ -17003,7 +17003,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
x -= tooltip.element.outerWidth() + 15;
}
var bodyHeight = BI.Widget._renderEngine.createElement("body").outerHeight();
if (y + tooltip.element.outerHeight() > bodyHeight || (!opt.belowMouse && top + tooltip.element.outerHeight() > bodyHeight)) {
if (y + tooltip.element.outerHeight() > bodyHeight || top + tooltip.element.outerHeight() > bodyHeight) {
y -= tooltip.element.outerHeight() + 15;
!opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
} else {
@ -33515,7 +33515,6 @@ BI.Label = BI.inherit(BI.Single, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
wrapAlign: "center", // 换行之后的文本的文本是都需要居中对齐,在textAlign为center时生效
forceCenter: false, // 是否无论如何都要居中, 不考虑超出边界的情况, 在未知宽度和高度时有效
textWidth: null,
textHeight: null,
@ -33533,7 +33532,7 @@ BI.Label = BI.inherit(BI.Single, {
_createJson: function () {
var o = this.options;
var obj = {
return {
type: "bi.text",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
@ -33543,10 +33542,6 @@ BI.Label = BI.inherit(BI.Single, {
py: o.py,
keyword: o.keyword
};
if(o.textAlign === "center") {
obj.textAlign = o.wrapAlign;
}
return obj;
},
_init: function () {
@ -33562,6 +33557,7 @@ BI.Label = BI.inherit(BI.Single, {
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
if (BI.isNumber(o.height) && o.height > 0) {
@ -33585,6 +33581,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.textWidth;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -33632,6 +33629,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -33703,6 +33701,8 @@ BI.Label = BI.inherit(BI.Single, {
this.element.css({
"line-height": o.height + "px"
});
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));
@ -33730,6 +33730,8 @@ BI.Label = BI.inherit(BI.Single, {
});
return;
}
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

14
src/base/single/label/label.js

@ -9,7 +9,6 @@ BI.Label = BI.inherit(BI.Single, {
baseCls: (conf.baseCls || "") + " bi-label",
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
wrapAlign: "center", // 换行之后的文本的文本是都需要居中对齐,在textAlign为center时生效
forceCenter: false, // 是否无论如何都要居中, 不考虑超出边界的情况, 在未知宽度和高度时有效
textWidth: null,
textHeight: null,
@ -27,7 +26,7 @@ BI.Label = BI.inherit(BI.Single, {
_createJson: function () {
var o = this.options;
var obj = {
return {
type: "bi.text",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
@ -37,10 +36,6 @@ BI.Label = BI.inherit(BI.Single, {
py: o.py,
keyword: o.keyword
};
if(o.textAlign === "center") {
obj.textAlign = o.wrapAlign;
}
return obj;
},
_init: function () {
@ -56,6 +51,7 @@ BI.Label = BI.inherit(BI.Single, {
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
if (BI.isNumber(o.height) && o.height > 0) {
@ -79,6 +75,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.textWidth;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -126,6 +123,7 @@ BI.Label = BI.inherit(BI.Single, {
return;
}
json.width = o.width - 2 * o.hgap;
json.textAlign = o.textAlign;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
@ -197,6 +195,8 @@ BI.Label = BI.inherit(BI.Single, {
this.element.css({
"line-height": o.height + "px"
});
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));
@ -224,6 +224,8 @@ BI.Label = BI.inherit(BI.Single, {
});
return;
}
// 能走到这边,说明这个text不需要换行,并且不会做任何布局包装,那么这时候就该是什么align是什么align
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this
}));

2
src/core/controller/controller.tooltips.js

@ -93,7 +93,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, {
x -= tooltip.element.outerWidth() + 15;
}
var bodyHeight = BI.Widget._renderEngine.createElement("body").outerHeight();
if (y + tooltip.element.outerHeight() > bodyHeight || (!opt.belowMouse && top + tooltip.element.outerHeight() > bodyHeight)) {
if (y + tooltip.element.outerHeight() > bodyHeight || top + tooltip.element.outerHeight() > bodyHeight) {
y -= tooltip.element.outerHeight() + 15;
!opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
} else {

Loading…
Cancel
Save