浏览代码

`updateSelected()` traversing too far, hit performance

Fix #1192
Example [here](http://jsfiddle.net/qdywt77g/) with bug
Example [here](http://jsfiddle.net/qdywt77g/1/) without bug
Dennis Hernández 10 年之前
父节点
当前提交
d948633fb3
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/bootstrap-table.js

+ 1 - 1
src/bootstrap-table.js

@@ -1733,7 +1733,7 @@
         this.$selectAll.add(this.$selectAll_).prop('checked', checkAll);
 
         this.$selectItem.each(function () {
-            $(this).parents('tr')[$(this).prop('checked') ? 'addClass' : 'removeClass']('selected');
+            $(this).closest('tr')[$(this).prop('checked') ? 'addClass' : 'removeClass']('selected');
         });
     };