From 9c9f3bf695ffb9abaedcb0d50d6d262d667d94a7 Mon Sep 17 00:00:00 2001 From: Young Date: Wed, 15 Nov 2017 11:49:30 +0800 Subject: [PATCH] =?UTF-8?q?BI-10727=20=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bi/widget.js | 14 ++++++++++++-- dist/bundle.js | 14 ++++++++++++-- dist/widget.js | 14 ++++++++++++-- src/widget/arrangement/arrangement.js | 14 ++++++++++++-- 4 files changed, 48 insertions(+), 8 deletions(-) diff --git a/bi/widget.js b/bi/widget.js index a6644c57af..a95f1d0f01 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -1045,7 +1045,7 @@ BI.Arrangement = BI.inherit(BI.Widget, { element: this.container }); } - this.wrapper.populate(items); + this.wrapper.addItems(items); }, getClientWidth: function () { @@ -1778,7 +1778,17 @@ BI.Arrangement = BI.inherit(BI.Widget, { }, populate: function (items) { - this.regions = {}; + // this.regions = {}; + var self = this; + BI.each(this.regions, function (name, region) { + var exist = BI.some(items, function (i, item) { + return item.el.attr("id") === name; + }); + if (!exist) { + self.regions[name].el.setVisible(false); + } + delete self.regions[name]; + }); this._populate(items); this._renderRegion(); } diff --git a/dist/bundle.js b/dist/bundle.js index 18d6f644fe..029f202c12 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -76087,7 +76087,7 @@ BI.Arrangement = BI.inherit(BI.Widget, { element: this.container }); } - this.wrapper.populate(items); + this.wrapper.addItems(items); }, getClientWidth: function () { @@ -76820,7 +76820,17 @@ BI.Arrangement = BI.inherit(BI.Widget, { }, populate: function (items) { - this.regions = {}; + // this.regions = {}; + var self = this; + BI.each(this.regions, function (name, region) { + var exist = BI.some(items, function (i, item) { + return item.el.attr("id") === name; + }); + if (!exist) { + self.regions[name].el.setVisible(false); + } + delete self.regions[name]; + }); this._populate(items); this._renderRegion(); } diff --git a/dist/widget.js b/dist/widget.js index a6644c57af..a95f1d0f01 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -1045,7 +1045,7 @@ BI.Arrangement = BI.inherit(BI.Widget, { element: this.container }); } - this.wrapper.populate(items); + this.wrapper.addItems(items); }, getClientWidth: function () { @@ -1778,7 +1778,17 @@ BI.Arrangement = BI.inherit(BI.Widget, { }, populate: function (items) { - this.regions = {}; + // this.regions = {}; + var self = this; + BI.each(this.regions, function (name, region) { + var exist = BI.some(items, function (i, item) { + return item.el.attr("id") === name; + }); + if (!exist) { + self.regions[name].el.setVisible(false); + } + delete self.regions[name]; + }); this._populate(items); this._renderRegion(); } diff --git a/src/widget/arrangement/arrangement.js b/src/widget/arrangement/arrangement.js index 5105990914..fc7d71d2f3 100644 --- a/src/widget/arrangement/arrangement.js +++ b/src/widget/arrangement/arrangement.js @@ -298,7 +298,7 @@ BI.Arrangement = BI.inherit(BI.Widget, { element: this.container }); } - this.wrapper.populate(items); + this.wrapper.addItems(items); }, getClientWidth: function () { @@ -1031,7 +1031,17 @@ BI.Arrangement = BI.inherit(BI.Widget, { }, populate: function (items) { - this.regions = {}; + // this.regions = {}; + var self = this; + BI.each(this.regions, function (name, region) { + var exist = BI.some(items, function (i, item) { + return item.el.attr("id") === name; + }); + if (!exist) { + self.regions[name].el.setVisible(false); + } + delete self.regions[name]; + }); this._populate(items); this._renderRegion(); }