浏览代码

Only set sortOrder and sortName to undefined if sortPriority (multi-sort
extension) is used

Dustin Utecht 4 年之前
父节点
当前提交
73145886e6
共有 1 个文件被更改,包括 3 次插入5 次删除
  1. 3 5
      src/extensions/cookie/bootstrap-table-cookie.js

+ 3 - 5
src/extensions/cookie/bootstrap-table-cookie.js

@@ -511,16 +511,14 @@ $.BootstrapTable = class extends $.BootstrapTable {
       throw new Error('Could not parse the json of the sortPriority cookie!', sortPriorityCookie)
       throw new Error('Could not parse the json of the sortPriority cookie!', sortPriorityCookie)
     }
     }
 
 
-    // sortOrder
-    this.options.sortOrder = undefined
-    // sortName
-    this.options.sortName = undefined
-
     if (!sortPriorityCookie) {
     if (!sortPriorityCookie) {
       // sortOrder
       // sortOrder
       this.options.sortOrder = sortOrderCookie ? sortOrderCookie : this.options.sortOrder
       this.options.sortOrder = sortOrderCookie ? sortOrderCookie : this.options.sortOrder
       // sortName
       // sortName
       this.options.sortName = sortOrderNameCookie ? sortOrderNameCookie : this.options.sortName
       this.options.sortName = sortOrderNameCookie ? sortOrderNameCookie : this.options.sortName
+    } else {
+      this.options.sortOrder = undefined
+      this.options.sortName = undefined
     }
     }
 
 
     // sortPriority
     // sortPriority