|
|
@ -20,7 +20,8 @@ |
|
|
|
bgap: 0, |
|
|
|
bgap: 0, |
|
|
|
text: "", |
|
|
|
text: "", |
|
|
|
py: "", |
|
|
|
py: "", |
|
|
|
highLight: false |
|
|
|
highLight: false, |
|
|
|
|
|
|
|
lineNumber: null, |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
render: function () { |
|
|
@ -54,12 +55,20 @@ |
|
|
|
if (BI.isWidthOrHeight(o.maxWidth)) { |
|
|
|
if (BI.isWidthOrHeight(o.maxWidth)) { |
|
|
|
this.element.css({maxWidth: o.maxWidth}); |
|
|
|
this.element.css({maxWidth: o.maxWidth}); |
|
|
|
} |
|
|
|
} |
|
|
|
this.element.css({ |
|
|
|
var cssObj = { |
|
|
|
textAlign: o.textAlign, |
|
|
|
textAlign: o.textAlign, |
|
|
|
whiteSpace: this._getTextWrap(), |
|
|
|
whiteSpace: this._getTextWrap(), |
|
|
|
textOverflow: o.whiteSpace === "nowrap" ? "ellipsis" : "", |
|
|
|
textOverflow: o.whiteSpace === "nowrap" ? "ellipsis" : "", |
|
|
|
overflow: o.whiteSpace === "nowrap" ? "" : (BI.isWidthOrHeight(o.height) ? "auto" : "") |
|
|
|
overflow: o.whiteSpace === "nowrap" ? "" : (BI.isWidthOrHeight(o.height) ? "auto" : ""), |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
if (BI.isNumber(o.lineNumber)) { |
|
|
|
|
|
|
|
BI.extend(cssObj, { |
|
|
|
|
|
|
|
display: "-webkit-box", |
|
|
|
|
|
|
|
"-webkit-line-clamp": o.lineNumber + "", |
|
|
|
|
|
|
|
"-webkit-box-orient": "vertical", |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.element.css(cssObj); |
|
|
|
if (o.handler && o.handler !== BI.emptyFn) { |
|
|
|
if (o.handler && o.handler !== BI.emptyFn) { |
|
|
|
this.text = BI.createWidget({ |
|
|
|
this.text = BI.createWidget({ |
|
|
|
type: "bi.layout", |
|
|
|
type: "bi.layout", |
|
|
|