浏览代码

Merge branch 'fix/5681' of github.com:wenzhixin/bootstrap-table into fix/5681

Dustin Utecht 4 年之前
父节点
当前提交
24fc7f3c21

+ 1 - 1
site/docs/extensions/reorder-rows.md

@@ -108,7 +108,7 @@ if you want you can include the bootstrap-table-reorder-rows.css file to use the
 
 
    **Note: This option is mainly used to adapt to the `TableDnD` plugin. Under no special circumstances, please do not modify the default value.**
    **Note: This option is mainly used to adapt to the `TableDnD` plugin. Under no special circumstances, please do not modify the default value.**
 
 
-- **Default:** `>tbody>tr>td`
+- **Default:** `>tbody>tr>td:not(.bs-checkbox)`
 
 
 ### useRowAttrFunc
 ### useRowAttrFunc
 
 

+ 13 - 3
src/bootstrap-table.js

@@ -67,12 +67,22 @@ class BootstrapTable {
         parts[1] = parts[1].toUpperCase()
         parts[1] = parts[1].toUpperCase()
       }
       }
 
 
+      let localesToExtend = {}
+
       if (locales[this.options.locale]) {
       if (locales[this.options.locale]) {
-        $.extend(this.options, locales[this.options.locale])
+        localesToExtend = locales[this.options.locale]
       } else if (locales[parts.join('-')]) {
       } else if (locales[parts.join('-')]) {
-        $.extend(this.options, locales[parts.join('-')])
+        localesToExtend = locales[parts.join('-')]
       } else if (locales[parts[0]]) {
       } else if (locales[parts[0]]) {
-        $.extend(this.options, locales[parts[0]])
+        localesToExtend = locales[parts[0]]
+      }
+
+      for (const [formatName, func] of Object.entries(localesToExtend)) {
+        if (this.options[formatName] !== BootstrapTable.DEFAULTS[formatName]) {
+          continue
+        }
+
+        this.options[formatName] = func
       }
       }
     }
     }
   }
   }

+ 1 - 1
src/extensions/reorder-rows/bootstrap-table-reorder-rows.js

@@ -13,7 +13,7 @@ $.extend($.fn.bootstrapTable.defaults, {
   onDragStyle: null,
   onDragStyle: null,
   onDropStyle: null,
   onDropStyle: null,
   onDragClass: 'reorder_rows_onDragClass',
   onDragClass: 'reorder_rows_onDragClass',
-  dragHandle: '>tbody>tr>td',
+  dragHandle: '>tbody>tr>td:not(.bs-checkbox)',
   useRowAttrFunc: false,
   useRowAttrFunc: false,
   // eslint-disable-next-line no-unused-vars
   // eslint-disable-next-line no-unused-vars
   onReorderRowsDrag (row) {
   onReorderRowsDrag (row) {