diff --git a/mip-showmore/mip-showmore.js b/mip-showmore/mip-showmore.js index 5054e48f3..944f2823c 100755 --- a/mip-showmore/mip-showmore.js +++ b/mip-showmore/mip-showmore.js @@ -202,6 +202,7 @@ define(function (require) { }; // 高度阈值控制 Showmore.prototype.toggle = function (event) { + var me = this; var classList = this.ele.classList; var clickBtn = event ? event.target : null; var opt = {}; @@ -230,7 +231,6 @@ define(function (require) { } else { // 显示超出字数的内容 - this.addClassWhenUnfold(); this.bottomShadow && this.showBox.classList.remove(this.bottomShadowClassName); opt.type = 'unfold'; originDom.classList.remove('mip-showmore-nodisplay'); @@ -240,6 +240,7 @@ define(function (require) { opt.cbFun = function (showmore) { showmore._toggleClickBtn(clickBtn, 'showClose'); classList.add('mip-showmore-boxshow'); + me.addClassWhenUnfold(); }.bind(undefined, this); } } @@ -256,13 +257,13 @@ define(function (require) { } else { // 显示超出高度的内容 - this.addClassWhenUnfold(); this.bottomShadow && this.showBox.classList.remove(this.bottomShadowClassName); classList.add('mip-showmore-boxshow'); opt.type = 'unfold'; opt.cbFun = function (showmore, clickBtn) { showmore._toggleClickBtn(clickBtn, 'showClose'); showmore.ele.style.height = 'auto'; + me.addClassWhenUnfold(); }.bind(undefined, this, clickBtn); } } diff --git a/mip-showmore/package.json b/mip-showmore/package.json index 17abab9bf..6ac988416 100755 --- a/mip-showmore/package.json +++ b/mip-showmore/package.json @@ -1,6 +1,6 @@ { "name": "mip-showmore", - "version": "1.1.2", + "version": "1.1.3", "description": "mip点击显示更多组件:新增加按屏折叠,折叠边界渐变", "contributors": [ {