From 3157371f890cbb457e68174dd14c9639a0b8bc93 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 22 Oct 2022 18:07:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0toPix=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/layer/layer.popup.js | 16 ++++++++-------- src/base/single/1.text.js | 14 +++++++------- src/base/single/button/buttons/button.icon.js | 2 +- src/base/single/button/buttons/button.js | 10 +++++----- src/base/single/html/html.js | 14 +++++++------- src/base/single/label/abstract.label.js | 8 ++++---- src/base/single/label/icon.label.js | 2 +- src/base/single/tip/tip.toast.js | 4 ++-- src/base/single/tip/tip.tooltip.js | 2 +- src/case/list/list.select.js | 2 +- .../tree/treeexpander/tree.expander.popup.js | 4 ++-- src/core/4.widget.js | 4 ++-- src/core/constant/var.js | 19 ++++++++++++++++--- src/core/wrapper/layout.js | 10 +++++----- src/core/wrapper/layout/layout.flow.js | 8 ++++---- src/core/wrapper/layout/layout.inline.js | 8 ++++---- .../multilayerselecttree.popup.js | 2 +- .../multilayersingletree.popup.js | 2 +- .../multiselect/multiselect.loader.nobar.js | 2 +- src/widget/singleselect/singleselect.list.js | 2 +- 20 files changed, 74 insertions(+), 61 deletions(-) diff --git a/src/base/layer/layer.popup.js b/src/base/layer/layer.popup.js index 1e768ae2c..88d11ac89 100644 --- a/src/base/layer/layer.popup.js +++ b/src/base/layer/layer.popup.js @@ -60,8 +60,8 @@ BI.PopupView = BI.inherit(BI.Widget, { } this.element.css({ "z-index": BI.zIndex_popup, - "min-width": BI.isNumeric(o.minWidth) ? (BI.pixFormat(o.minWidth)) : o.minWidth, - "max-width": BI.isNumeric(o.maxWidth) ? (BI.pixFormat(o.maxWidth)) : o.maxWidth, + "min-width": BI.toPix(o.minWidth), + "max-width": BI.toPix(o.maxWidth), }).bind({ click: fn }); this.element.bind("mousewheel", fn); @@ -135,11 +135,11 @@ BI.PopupView = BI.inherit(BI.Widget, { var o = this.options; this.button_group = BI.createWidget(o.el, { type: "bi.button_group", value: o.value }); this.button_group.element.css({ - "min-height": BI.isNumeric(o.minHeight) ? (BI.pixFormat(o.minHeight)) : o.minHeight, - "padding-top": BI.pixFormat(o.innerVgap), - "padding-bottom": BI.pixFormat(o.innerVgap), - "padding-left": BI.pixFormat(o.innerHgap), - "padding-right": BI.pixFormat(o.innerHgap), + "min-height": BI.toPix(o.minHeight), + "padding-top": BI.toPix(o.innerVgap), + "padding-bottom": BI.toPix(o.innerVgap), + "padding-left": BI.toPix(o.innerHgap), + "padding-right": BI.toPix(o.innerHgap), }); return this.button_group; @@ -411,7 +411,7 @@ BI.PopupView = BI.inherit(BI.Widget, { toolHeight = ((this.tool && this.tool.attr("height")) || 24) * ((this.tool && this.tool.isVisible()) ? 1 : 0); var resetHeight = h - tbHeight - tabHeight - toolHeight - 2 * this.options.innerVgap; this.view.resetHeight ? this.view.resetHeight(resetHeight) : - this.view.element.css({ "max-height": BI.pixFormat(resetHeight) }); + this.view.element.css({ "max-height": BI.toPix(resetHeight) }); }, setValue: function (selectedValues) { diff --git a/src/base/single/1.text.js b/src/base/single/1.text.js index 9c4244a9d..03acbc948 100644 --- a/src/base/single/1.text.js +++ b/src/base/single/1.text.js @@ -26,32 +26,32 @@ var self = this, o = this.options; if (o.hgap + o.lgap > 0) { this.element.css({ - "padding-left": BI.pixFormat(o.hgap + o.lgap), + "padding-left": BI.toPix(o.hgap + o.lgap), }); } if (o.hgap + o.rgap > 0) { this.element.css({ - "padding-right": BI.pixFormat(o.hgap + o.rgap), + "padding-right": BI.toPix(o.hgap + o.rgap), }); } if (o.vgap + o.tgap > 0) { this.element.css({ - "padding-top": BI.pixFormat(o.vgap + o.tgap), + "padding-top": BI.toPix(o.vgap + o.tgap), }); } if (o.vgap + o.bgap > 0) { this.element.css({ - "padding-bottom": BI.pixFormat(o.vgap + o.bgap), + "padding-bottom": BI.toPix(o.vgap + o.bgap), }); } if (BI.isWidthOrHeight(o.height)) { - this.element.css({ lineHeight: BI.isNumber(o.height) ? BI.pixFormat(o.height) : o.height }); + this.element.css({ lineHeight: BI.toPix(o.height) }); } if (BI.isWidthOrHeight(o.lineHeight)) { - this.element.css({ lineHeight: BI.isNumber(o.lineHeight) ? BI.pixFormat(o.lineHeight) : o.lineHeight }); + this.element.css({ lineHeight: BI.toPix(o.lineHeight) }); } if (BI.isWidthOrHeight(o.maxWidth)) { - this.element.css({ maxWidth: BI.isNumber(o.maxWidth) ? BI.pixFormat(o.maxWidth) : o.maxWidth }); + this.element.css({ maxWidth: BI.toPix(o.maxWidth) }); } this.element.css({ textAlign: o.textAlign, diff --git a/src/base/single/button/buttons/button.icon.js b/src/base/single/button/buttons/button.icon.js index 045126c38..53cccf058 100644 --- a/src/base/single/button/buttons/button.icon.js +++ b/src/base/single/button/buttons/button.icon.js @@ -31,7 +31,7 @@ BI.IconButton = BI.inherit(BI.BasicButton, { height: o.iconHeight, }); if (BI.isNumber(o.height) && o.height > 0 && BI.isNull(o.iconWidth) && BI.isNull(o.iconHeight)) { - this.element.css("lineHeight", BI.pixFormat(o.height)); + this.element.css("lineHeight", BI.toPix(o.height)); BI.createWidget({ type: "bi.default", element: this, diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index a8da2e32b..ca0598ec4 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -98,8 +98,8 @@ type: "bi.icon_label", cls: o.loading ? loadingCls : (o.iconCls || o.icon), width: this._const.iconWidth, - height: BI.pixFormat(lineHeight, hasBorder ? 2 : 0), - lineHeight: BI.pixFormat(lineHeight, hasBorder ? 2 : 0), + height: BI.toPix(lineHeight, hasBorder ? 2 : 0), + lineHeight: BI.toPix(lineHeight, hasBorder ? 2 : 0), // 不设置,自定义按钮无法居中 iconWidth: o.iconWidth, iconHeight: o.iconHeight, @@ -120,8 +120,8 @@ whiteSpace: o.whiteSpace, textAlign: o.textAlign, textWidth: textWidth, - textHeight: BI.pixFormat(textHeight, hasBorder ? 2 : 0), - height: BI.pixFormat(lineHeight, hasBorder ? 2 : 0), + textHeight: BI.toPix(textHeight, hasBorder ? 2 : 0), + height: BI.toPix(lineHeight, hasBorder ? 2 : 0), value: o.value, title: null, }); @@ -163,7 +163,7 @@ }); if (o.minWidth > 0) { - this.element.css({ "min-width": BI.pixFormat(o.minWidth) }); + this.element.css({ "min-width": BI.toPix(o.minWidth) }); } }, diff --git a/src/base/single/html/html.js b/src/base/single/html/html.js index 84c980427..f6be1ff27 100644 --- a/src/base/single/html/html.js +++ b/src/base/single/html/html.js @@ -25,35 +25,35 @@ BI.Html = BI.inherit(BI.Single, { var self = this, o = this.options; if (o.hgap + o.lgap > 0) { this.element.css({ - "padding-left": BI.pixFormat(o.hgap + o.lgap), + "padding-left": BI.toPix(o.hgap + o.lgap), }); } if (o.hgap + o.rgap > 0) { this.element.css({ - "padding-right": BI.pixFormat(o.hgap + o.rgap), + "padding-right": BI.toPix(o.hgap + o.rgap), }); } if (o.vgap + o.tgap > 0) { this.element.css({ - "padding-top": BI.pixFormat(o.vgap + o.tgap), + "padding-top": BI.toPix(o.vgap + o.tgap), }); } if (o.vgap + o.bgap > 0) { this.element.css({ - "padding-bottom": BI.pixFormat(o.vgap + o.bgap), + "padding-bottom": BI.toPix(o.vgap + o.bgap), }); } if (BI.isNumber(o.height)) { - this.element.css({ lineHeight: BI.pixFormat(o.height) }); + this.element.css({ lineHeight: BI.toPix(o.height) }); } if (BI.isNumber(o.lineHeight)) { - this.element.css({ lineHeight: BI.pixFormat(o.lineHeight) }); + this.element.css({ lineHeight: BI.toPix(o.lineHeight) }); } if (BI.isWidthOrHeight(o.maxWidth)) { this.element.css({ maxWidth: o.maxWidth }); } if (BI.isNumber(o.maxWidth)) { - this.element.css({ maxWidth: BI.pixFormat(o.maxWidth) }) + this.element.css({ maxWidth: BI.toPix(o.maxWidth) }) } this.element.css({ textAlign: o.textAlign, diff --git a/src/base/single/label/abstract.label.js b/src/base/single/label/abstract.label.js index 19fc0322d..041be7a3e 100644 --- a/src/base/single/label/abstract.label.js +++ b/src/base/single/label/abstract.label.js @@ -109,7 +109,7 @@ } if (BI.isNumber(o.height) && o.height > 0) { // 1.4 this.element.css({ - "line-height": BI.pixFormat(o.height), + "line-height": BI.toPix(o.height), }); json.textAlign = o.textAlign; delete json.maxWidth; @@ -183,7 +183,7 @@ } if (BI.isNumber(o.height) && o.height > 0) { // 1.8 this.element.css({ - "line-height": BI.pixFormat(o.height), + "line-height": BI.toPix(o.height), }); json.textAlign = o.textAlign; delete json.maxWidth; @@ -263,7 +263,7 @@ if (BI.isNumber(o.height) && o.height > 0) { // 2.3 if (o.whiteSpace !== "normal") { this.element.css({ - "line-height": BI.pixFormat(o.height - (o.vgap * 2)), + "line-height": BI.toPix(o.height - (o.vgap * 2)), }); } delete json.maxWidth; @@ -325,7 +325,7 @@ if (BI.isNumber(o.height) && o.height > 0) { if (o.whiteSpace !== "normal") { this.element.css({ - "line-height": BI.pixFormat(o.height - (o.vgap * 2)), + "line-height": BI.toPix(o.height - (o.vgap * 2)), }); } delete json.maxWidth; diff --git a/src/base/single/label/icon.label.js b/src/base/single/label/icon.label.js index 53a400a05..e14b12685 100644 --- a/src/base/single/label/icon.label.js +++ b/src/base/single/label/icon.label.js @@ -29,7 +29,7 @@ BI.IconLabel = BI.inherit(BI.Single, { height: o.iconHeight, }); if (BI.isNumber(o.height) && o.height > 0 && BI.isNull(o.iconWidth) && BI.isNull(o.iconHeight)) { - this.element.css("lineHeight", BI.pixFormat(o.lineHeight || o.height)); + this.element.css("lineHeight", BI.toPix(o.lineHeight || o.height)); BI.createWidget({ type: "bi.default", element: this, diff --git a/src/base/single/tip/tip.toast.js b/src/base/single/tip/tip.toast.js index 18af9e8e7..128eaa093 100644 --- a/src/base/single/tip/tip.toast.js +++ b/src/base/single/tip/tip.toast.js @@ -31,8 +31,8 @@ BI.Toast = BI.inherit(BI.Tip, { var self = this, o = this.options, c = this._const; this.element.css({ // 这里直接使用px即可 - minWidth: BI.pixFormat(o.closable ? c.closableMinWidth : c.minWidth), - maxWidth: BI.pixFormat(o.closable ? c.closableMaxWidth : c.maxWidth), + minWidth: BI.toPix(o.closable ? c.closableMinWidth : c.minWidth), + maxWidth: BI.toPix(o.closable ? c.closableMaxWidth : c.maxWidth), }); this.element.addClass("toast-" + o.level); function fn(e) { diff --git a/src/base/single/tip/tip.tooltip.js b/src/base/single/tip/tip.tooltip.js index aae6d8e86..28aeccf7a 100644 --- a/src/base/single/tip/tip.tooltip.js +++ b/src/base/single/tip/tip.tooltip.js @@ -73,7 +73,7 @@ BI.Tooltip = BI.inherit(BI.Tip, { }, setWidth: function (width) { - this.element.width(BI.pixFormat(width - 2 * this._const.hgap)); + this.element.width(BI.toPix(width - 2 * this._const.hgap)); }, setText: function (text) { diff --git a/src/case/list/list.select.js b/src/case/list/list.select.js index dfb3d7c1a..11e65ff92 100644 --- a/src/case/list/list.select.js +++ b/src/case/list/list.select.js @@ -192,7 +192,7 @@ BI.SelectList = BI.inherit(BI.Widget, { resetHeight: function (h) { var toolHeight = ( this.toolbar.element.outerHeight() || 25) * ( this.toolbar.isVisible() ? 1 : 0); this.list.resetHeight ? this.list.resetHeight(h - toolHeight) : - this.list.element.css({"max-height": BI.pixFormat(h - toolHeight)}); + this.list.element.css({"max-height": BI.toPix(h - toolHeight)}); }, setNotSelectedValue: function () { diff --git a/src/case/tree/treeexpander/tree.expander.popup.js b/src/case/tree/treeexpander/tree.expander.popup.js index ada979b0e..c8c22794e 100644 --- a/src/case/tree/treeexpander/tree.expander.popup.js +++ b/src/case/tree/treeexpander/tree.expander.popup.js @@ -25,8 +25,8 @@ }); if (o.showLine) { - this.popupView.element.css("margin-left", BI.pixFormat(-offset * (o.layer + 1))); - this.element.css("margin-left", BI.pixFormat(offset * (o.layer + 1))); + this.popupView.element.css("margin-left", BI.toPix(-offset * (o.layer + 1))); + this.element.css("margin-left", BI.toPix(offset * (o.layer + 1))); } return { diff --git a/src/core/4.widget.js b/src/core/4.widget.js index bca87b9fc..44617d076 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -289,14 +289,14 @@ _initElementWidth: function () { var o = this.options; if (BI.isWidthOrHeight(o.width)) { - this.element.css("width", BI.isNumber(o.width) ? BI.pixFormat(o.width) : o.width); + this.element.css("width", BI.toPix(o.width)); } }, _initElementHeight: function () { var o = this.options; if (BI.isWidthOrHeight(o.height)) { - this.element.css("height", BI.isNumber(o.height) ? BI.pixFormat(o.height) : o.height); + this.element.css("height", BI.toPix(o.height)); } }, diff --git a/src/core/constant/var.js b/src/core/constant/var.js index fc89511f5..f0a4e2db8 100644 --- a/src/core/constant/var.js +++ b/src/core/constant/var.js @@ -15,12 +15,13 @@ BI._.extend(BI, { emptyStr: "", pixUnit: "px", pixRatio: 1, - pixFormat: function (pix, border) { + // 一定返回最终的单位 + toPix: function (pix, border) { if (!BI.isNumber(pix)) { return pix; } - if (BI.pixUnit === "px" && BI.pixRatio === 1) { - return (pix - (border || 0)) / BI.pixRatio + BI.pixUnit; + if (BI.pixUnit === "px") { + return (pix / BI.pixRatio - (border || 0)) + BI.pixUnit; } var length = pix / BI.pixRatio + BI.pixUnit; if (border > 0) { @@ -28,6 +29,18 @@ BI._.extend(BI, { } return length; }, + pixFormat: function (pix, border) { + if (!BI.isNumber(pix)) { + return pix; + } + if (BI.pixUnit === "px") { + return pix - (border || 0) * BI.pixRatio; + } + if (border > 0) { + return `calc(${pix / BI.pixRatio + BI.pixUnit} - ${border + "px"})`; + } + return pix; + }, emptyFn: function () { }, empty: null, diff --git a/src/core/wrapper/layout.js b/src/core/wrapper/layout.js index b1ae46ba7..6b574d537 100644 --- a/src/core/wrapper/layout.js +++ b/src/core/wrapper/layout.js @@ -42,16 +42,16 @@ BI.Layout = BI.inherit(BI.Widget, { _init4Margin: function () { if (this.options.top) { - this.element.css("top", BI.isNumber(this.options.top) ? BI.pixFormat(this.options.top) : this.options.top); + this.element.css("top", BI.toPix(this.options.top)); } if (this.options.left) { - this.element.css("left", BI.isNumber(this.options.left) ? BI.pixFormat(this.options.left) : this.options.left); + this.element.css("left", BI.toPix(this.options.left)); } if (this.options.bottom) { - this.element.css("bottom", BI.isNumber(this.options.bottom) ? BI.pixFormat(this.options.bottom) : this.options.bottom); + this.element.css("bottom", BI.toPix(this.options.bottom)); } if (this.options.right) { - this.element.css("right", BI.isNumber(this.options.right) ? BI.pixFormat(this.options.right) : this.options.right); + this.element.css("right", BI.toPix(this.options.right)); } }, @@ -289,7 +289,7 @@ BI.Layout = BI.inherit(BI.Widget, { }, _optimiseGap: function (gap) { - return (gap > 0 && gap < 1) ? (gap * 100).toFixed(1) + "%" : BI.pixFormat(gap); + return (gap > 0 && gap < 1) ? (gap * 100).toFixed(1) + "%" : BI.toPix(gap); }, _optimiseItemLgap: function (item) { diff --git a/src/core/wrapper/layout/layout.flow.js b/src/core/wrapper/layout/layout.flow.js index de14999f7..6443b7840 100644 --- a/src/core/wrapper/layout/layout.flow.js +++ b/src/core/wrapper/layout/layout.flow.js @@ -137,16 +137,16 @@ BI.FloatRightLayout = BI.inherit(BI.Layout, { var w = BI.FloatRightLayout.superclass._addElement.apply(this, arguments); w.element.css({position: "relative", float: "right"}); if (BI.isNotNull(item.left)) { - w.element.css({left: BI.isNumber(item.left) ? BI.pixFormat(item.left) : item.left}); + w.element.css({left: BI.toPix(item.left)}); } if (BI.isNotNull(item.right)) { - w.element.css({right: BI.isNumber(item.right) ? BI.pixFormat(item.right) : item.right}); + w.element.css({right: BI.toPix(item.right)}); } if (BI.isNotNull(item.top)) { - w.element.css({top: BI.isNumber(item.top) ? BI.pixFormat(item.top) : item.top}); + w.element.css({top: BI.toPix(item.top)}); } if (BI.isNotNull(item.bottom)) { - w.element.css({bottom: BI.isNumber(item.bottom) ? BI.pixFormat(item.bottom) : item.bottom}); + w.element.css({bottom: BI.toPix(item.bottom)}); } if (o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { var top = o.vgap / 2 + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); diff --git a/src/core/wrapper/layout/layout.inline.js b/src/core/wrapper/layout/layout.inline.js index 661a6bf77..f3b0e2f22 100644 --- a/src/core/wrapper/layout/layout.inline.js +++ b/src/core/wrapper/layout/layout.inline.js @@ -47,7 +47,7 @@ BI.InlineLayout = BI.inherit(BI.Layout, { } } if (columnSize > 0) { - w.element.width(columnSize < 1 ? ((columnSize * 100).toFixed(1) + "%") : BI.pixFormat(columnSize)); + w.element.width(columnSize < 1 ? ((columnSize * 100).toFixed(1) + "%") : BI.toPix(columnSize)); } w.element.css({ position: "relative", @@ -69,8 +69,8 @@ BI.InlineLayout = BI.inherit(BI.Layout, { gap += o.hgap + o.lgap + o.rgap + this._optimiseItemLgap(o.items[k]) + this._optimiseItemRgap(o.items[k]) + this._optimiseItemHgap(o.items[k]); length += cz; } - length = length > 0 && length < 1 ? (length * 100).toFixed(1) + "%" : BI.pixFormat(length); - gap = gap > 0 && gap < 1 ? (gap * 100).toFixed(1) + "%" : BI.pixFormat(gap); + length = length > 0 && length < 1 ? (length * 100).toFixed(1) + "%" : BI.toPix(length); + gap = gap > 0 && gap < 1 ? (gap * 100).toFixed(1) + "%" : BI.toPix(gap); if (columnSize === "fill") { w.element.css("min-width", "calc((100% - " + length + " - " + gap + ")" + (fillCount > 1 ? "/" + fillCount : "") + ")"); } @@ -86,7 +86,7 @@ BI.InlineLayout = BI.inherit(BI.Layout, { if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) { var top = o.innerVgap + o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item), bottom = o.innerVgap + o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); - var gap = (top + bottom) > 0 && (top + bottom) < 1 ? ((top + bottom) * 100).toFixed(1) + "%" : BI.pixFormat(top + bottom); + var gap = (top + bottom) > 0 && (top + bottom) < 1 ? ((top + bottom) * 100).toFixed(1) + "%" : BI.toPix(top + bottom); w.element.css("height", "calc(100% - " + gap + ")"); } return w; diff --git a/src/widget/multilayerselecttree/multilayerselecttree.popup.js b/src/widget/multilayerselecttree/multilayerselecttree.popup.js index 34dce3a58..fbe175af0 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.popup.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.popup.js @@ -56,7 +56,7 @@ BI.MultiLayerSelectTreePopup = BI.inherit(BI.Widget, { self.fireEvent(BI.MultiLayerSelectTreePopup.EVENT_CHANGE); }); - this.tree.css("min-height", BI.pixFormat(o.minHeight - 10)); + this.tree.css("min-height", BI.toPix(o.minHeight - 10)); }, getValue: function () { diff --git a/src/widget/multilayersingletree/multilayersingletree.popup.js b/src/widget/multilayersingletree/multilayersingletree.popup.js index 630c38237..666bdeb88 100644 --- a/src/widget/multilayersingletree/multilayersingletree.popup.js +++ b/src/widget/multilayersingletree/multilayersingletree.popup.js @@ -55,7 +55,7 @@ BI.MultiLayerSingleTreePopup = BI.inherit(BI.Widget, { self.fireEvent(BI.MultiLayerSingleTreePopup.EVENT_CHANGE); }); - this.tree.css("min-height", BI.pixFormat(o.minHeight - 10)); + this.tree.css("min-height", BI.toPix(o.minHeight - 10)); }, getValue: function () { diff --git a/src/widget/multiselect/multiselect.loader.nobar.js b/src/widget/multiselect/multiselect.loader.nobar.js index c8e259cd3..dde974df8 100644 --- a/src/widget/multiselect/multiselect.loader.nobar.js +++ b/src/widget/multiselect/multiselect.loader.nobar.js @@ -173,7 +173,7 @@ BI.MultiSelectNoBarLoader = BI.inherit(BI.Widget, { }, resetHeight: function (h) { - this.button_group.element.css({ "max-height": BI.pixFormat(h) }); + this.button_group.element.css({ "max-height": BI.toPix(h) }); }, resetWidth: function () { diff --git a/src/widget/singleselect/singleselect.list.js b/src/widget/singleselect/singleselect.list.js index 9842eb3ea..e60ea267a 100644 --- a/src/widget/singleselect/singleselect.list.js +++ b/src/widget/singleselect/singleselect.list.js @@ -120,7 +120,7 @@ BI.SingleSelectList = BI.inherit(BI.Widget, { resetHeight: function (h) { this.list.resetHeight ? this.list.resetHeight(h) : - this.list.element.css({"max-height": BI.pixFormat(h - (this.options.allowNoSelect ? this._constants.itemHeight : 0))}); + this.list.element.css({"max-height": BI.toPix(h - (this.options.allowNoSelect ? this._constants.itemHeight : 0))}); }, setNotSelectedValue: function () {