浏览代码

Changes applied

Dennis Hernández 9 年之前
父节点
当前提交
3667f00cf9
共有 1 个文件被更改,包括 2 次插入11 次删除
  1. 2 11
      src/bootstrap-table.js

+ 2 - 11
src/bootstrap-table.js

@@ -241,16 +241,6 @@
         return !!(navigator.userAgent.indexOf("MSIE ") > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./));
     };
 
-    var fitHeaderOnWindowResizeEvent = function (that) {
-        if (that.options.height) {
-            $(window).resize(function () {
-                setTimeout (function () {
-                    that.fitHeader();
-                }, 250);
-            });
-        }
-    };
-
     // BOOTSTRAP TABLE CLASS DEFINITION
     // ======================
 
@@ -836,6 +826,7 @@
             }
         });
 
+        $(window).off('resize.bootstrap-table');
         if (!this.options.showHeader || this.options.cardView) {
             this.$header.hide();
             this.$tableHeader.hide();
@@ -846,7 +837,7 @@
             this.$tableLoading.css('top', this.$header.outerHeight() + 1);
             // Assign the correct sortable arrow
             this.getCaret();
-            fitHeaderOnWindowResizeEvent(this);
+            $(window).on('resize.bootstrap-table', $.proxy(this.resetWidth, this));
         }
 
         this.$selectAll = this.$header.find('[name="btSelectAll"]');