From ebbf15b14519f5efbd54dc5ac99e82989c0be8a4 Mon Sep 17 00:00:00 2001 From: Kira Date: Tue, 25 Jun 2019 11:41:16 +0800 Subject: [PATCH] =?UTF-8?q?BI-46540=20refactor:=20all=5Fcount=5Fpager?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E6=98=AF=E5=90=A6=E6=98=BE=E7=A4=BA=E9=A1=B5?= =?UTF-8?q?=E7=A0=81=E7=9A=84=E9=80=BB=E8=BE=91=E6=94=BE=E5=88=B0=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E5=86=85=E9=83=A8=E5=A4=84=E7=90=86=EF=BC=8C=E5=92=8C?= =?UTF-8?q?direction=5Fpager=E7=BB=9F=E4=B8=80=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/pager/pager.all.count.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/case/pager/pager.all.count.js b/src/case/pager/pager.all.count.js index a273d65f5..71600b5f7 100644 --- a/src/case/pager/pager.all.count.js +++ b/src/case/pager/pager.all.count.js @@ -28,7 +28,8 @@ BI.AllCountPager = BI.inherit(BI.Widget, { value: o.curr, errorText: BI.i18nText("BI-Please_Input_Positive_Integer"), width: 40, - height: 24 + height: 24, + invisible: o.pages <= 1 }); this.pager = BI.createWidget({ @@ -68,7 +69,8 @@ BI.AllCountPager = BI.inherit(BI.Widget, { hasPrev: o.hasPrev, hasNext: o.hasNext, firstPage: o.firstPage, - lastPage: o.lastPage + lastPage: o.lastPage, + invisible: o.pages <= 1 }); this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () { @@ -86,7 +88,8 @@ BI.AllCountPager = BI.inherit(BI.Widget, { type: "bi.label", title: o.pages, text: "/" + o.pages, - lgap: 5 + lgap: 5, + invisible: o.pages <= 1 }); this.rowCount = BI.createWidget({ @@ -147,6 +150,7 @@ BI.AllCountPager = BI.inherit(BI.Widget, { setAllPages: function (v) { this.allPages.setText("/" + v); this.allPages.setTitle(v); + this.options.pages = v; this.pager.setAllPages(v); this.editor.setEnable(v >= 1); }, @@ -184,6 +188,7 @@ BI.AllCountPager = BI.inherit(BI.Widget, { populate: function () { this.pager.populate(); + this.setPagerVisible(this.options.pages > 1); } }); BI.AllCountPager.EVENT_CHANGE = "EVENT_CHANGE";