From 7871535f63ba8a22bd38a2faddc3905d60b923ae Mon Sep 17 00:00:00 2001 From: "Kevin.King" Date: Mon, 12 Dec 2022 10:28:08 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-84736=20feat:=20=E5=A4=9A=E9=97=A8?= =?UTF-8?q?=E6=88=B7=E9=A6=96=E9=A1=B5=E5=88=87=E6=8D=A2-=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E5=89=8D=E7=AB=AF=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/linearsegment/linear.segment.js | 10 +++++++++- src/case/segment/segment.js | 9 +++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/case/linearsegment/linear.segment.js b/src/case/linearsegment/linear.segment.js index b0b00f95b..41d282263 100644 --- a/src/case/linearsegment/linear.segment.js +++ b/src/case/linearsegment/linear.segment.js @@ -47,6 +47,14 @@ BI.LinearSegment = BI.inherit(BI.Widget, { getValue: function () { return this.buttonGroup.getValue(); - } + }, + + populate: function (buttons) { + var o = this.options; + this.buttonGroup.populate([BI.createItems(buttons, { + type: "bi.linear_segment_button", + height: o.height + })]) + }, }); BI.shortcut("bi.linear_segment", BI.LinearSegment); diff --git a/src/case/segment/segment.js b/src/case/segment/segment.js index 3f323ffb6..2c1dda918 100644 --- a/src/case/segment/segment.js +++ b/src/case/segment/segment.js @@ -58,6 +58,15 @@ BI.Segment = BI.inherit(BI.Widget, { getValue: function () { return this.buttonGroup.getValue(); }, + + populate: function (buttons) { + var o = this.options; + this.buttonGroup.populate([BI.createItems(buttons, { + type: "bi.segment_button", + height: BI.toPix(o.height, 2), + whiteSpace: o.whiteSpace, + })]); + }, }); BI.Segment.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.segment", BI.Segment);