浏览代码

fix searchtext cookie set by column filters'

ioctaptceb 10 年之前
父节点
当前提交
eb6850da54
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      src/extensions/cookie/bootstrap-table-cookie.js

+ 6 - 2
src/extensions/cookie/bootstrap-table-cookie.js

@@ -317,8 +317,12 @@
     };
 
     BootstrapTable.prototype.onSearch = function () {
-        _onSearch.apply(this, Array.prototype.slice.apply(arguments));
-        setCookie(this, cookieIds.searchText, this.searchText);
+        var target = Array.prototype.slice.apply(arguments);
+        _onSearch.apply(this, target);
+
+        if ($(target[0].currentTarget).parent().hasClass('search')) {
+          setCookie(this, cookieIds.searchText, this.searchText);
+        }
     };
 
     BootstrapTable.prototype.deleteCookie = function (cookieName) {