diff --git a/bi/core.js b/bi/core.js index 75319bb312..100e50c682 100644 --- a/bi/core.js +++ b/bi/core.js @@ -4537,6 +4537,14 @@ BI.Widget = BI.inherit(BI.OB, { }); }, + _setVisible: function (visible) { + if (visible === true) { + this.options.invisible = false; + } else if (visible === false) { + this.options.invisible = true; + } + }, + setEnable: function (enable) { this._setEnable(enable); if (enable === true) { @@ -4547,13 +4555,12 @@ BI.Widget = BI.inherit(BI.OB, { }, setVisible: function (visible) { + this._setVisible(visible); if (visible === true) { - this.options.invisible = false; //用this.element.show()会把display属性改成block this.element.css("display", ""); this._mount(); } else if (visible === false) { - this.options.invisible = true; this.element.css("display", "none"); } this.fireEvent(BI.Events.VIEW, visible); diff --git a/docs/core.js b/docs/core.js index ddbf75f1ac..5103bb804b 100644 --- a/docs/core.js +++ b/docs/core.js @@ -14539,6 +14539,14 @@ BI.Widget = BI.inherit(BI.OB, { }); }, + _setVisible: function (visible) { + if (visible === true) { + this.options.invisible = false; + } else if (visible === false) { + this.options.invisible = true; + } + }, + setEnable: function (enable) { this._setEnable(enable); if (enable === true) { @@ -14549,13 +14557,12 @@ BI.Widget = BI.inherit(BI.OB, { }, setVisible: function (visible) { + this._setVisible(visible); if (visible === true) { - this.options.invisible = false; //用this.element.show()会把display属性改成block this.element.css("display", ""); this._mount(); } else if (visible === false) { - this.options.invisible = true; this.element.css("display", "none"); } this.fireEvent(BI.Events.VIEW, visible); diff --git a/src/core/widget.js b/src/core/widget.js index dd9f56b3c4..a868b4d31e 100644 --- a/src/core/widget.js +++ b/src/core/widget.js @@ -214,6 +214,14 @@ BI.Widget = BI.inherit(BI.OB, { }); }, + _setVisible: function (visible) { + if (visible === true) { + this.options.invisible = false; + } else if (visible === false) { + this.options.invisible = true; + } + }, + setEnable: function (enable) { this._setEnable(enable); if (enable === true) { @@ -224,13 +232,12 @@ BI.Widget = BI.inherit(BI.OB, { }, setVisible: function (visible) { + this._setVisible(visible); if (visible === true) { - this.options.invisible = false; //用this.element.show()会把display属性改成block this.element.css("display", ""); this._mount(); } else if (visible === false) { - this.options.invisible = true; this.element.css("display", "none"); } this.fireEvent(BI.Events.VIEW, visible);