Browse Source

Merge pull request #4857 from wenzhixin/feature/fix-themes

Feature/fix themes
Dustin Utecht 5 years ago
parent
commit
44613ebc1a

+ 2 - 0
CHANGELOG.md

@@ -12,6 +12,7 @@ ChangeLog
 - **New:** Added `unfiltered` parameter for `getData` method.
 - **Update:** Updated `event` name to lowercase hyphen format for vue component.
 - **Update:** Updated `es-AR` locale.
+- **Update:** Updated the default classes of semantic theme.
 - **Update:** Improved the `resize` problem with multiple tables.
 - **Update:** Fixed `checkAll` event bug with sortable checkbox field.
 - **Update:** Fixed `checkbox` and not-found td style errors.
@@ -25,6 +26,7 @@ ChangeLog
 - **Update:** Fixed `removeAll` bug in the last page when sidePagination is server.
 - **Update:** Fixed `search` not always trigger in IE11 bug.
 - **Update:** Fixed `search` width `escape` bug.
+- **Update:** Fixed `showColumns` cannot work of foundation theme.
 - **Update:** Fixed `showFullscreen` bug when setting height.
 - **Update:** Fixed `sort` cannot work after searching.
 - **Update:** Fixed `sortable` style error when using `table-sm`.

+ 5 - 1
src/themes/foundation/bootstrap-table-foundation.js

@@ -76,8 +76,12 @@ $.BootstrapTable = class extends $.BootstrapTable {
     $dropdowns.off('click').on('click', e => {
       const $this = $(e.currentTarget)
       e.stopPropagation()
-      $dropdowns.not($this).next().foundation('close')
+
       $this.next().foundation('toggle')
+
+      if ($dropdowns.not($this).length) {
+        $dropdowns.not($this).next().foundation('close')
+      }
     })
 
     $(document).off('click.bs.dropdown.foundation').on('click.bs.dropdown.foundation', () => {

+ 11 - 13
src/themes/foundation/bootstrap-table-foundation.scss

@@ -21,22 +21,20 @@
       height: 2.5293rem;
     }
 
-    .keep-open {
-      .dropdown-container {
-        .button {
-          &:hover .menu {
-            background: #fff;
-          }
+    .keep-open.dropdown-container {
+      .button {
+        &:hover .menu {
+          background: #fff;
         }
+      }
 
-        .menu {
-          li {
-            padding: 5px 0;
+      .menu {
+        li {
+          padding: 5px 0;
 
-            label {
-              white-space: nowrap;
-              text-align: left;
-            }
+          label {
+            white-space: nowrap;
+            text-align: left;
           }
         }
       }

+ 1 - 1
src/themes/semantic/bootstrap-table-semantic.js

@@ -5,7 +5,7 @@
  */
 
 $.extend($.fn.bootstrapTable.defaults, {
-  classes: 'ui selectable celled table',
+  classes: 'ui selectable celled table unstackable',
   buttonsPrefix: '',
   buttonsClass: 'ui button'
 })