Browse Source

Fixed font-size of the loading text

zhixin 5 years ago
parent
commit
c0cd6f89e5
2 changed files with 7 additions and 1 deletions
  1. 7 0
      src/bootstrap-table.js
  2. 0 1
      src/themes/_theme.scss

+ 7 - 0
src/bootstrap-table.js

@@ -2695,6 +2695,13 @@ class BootstrapTable {
 
   showLoading () {
     this.$tableLoading.css('display', 'flex')
+
+    let fontSize = this.$tableLoading.width() * 0.04
+
+    fontSize = Math.max(12, fontSize)
+    fontSize = Math.min(32, fontSize)
+
+    this.$tableLoading.find('.loading-text').css('font-size', `${fontSize}px`)
   }
 
   hideLoading () {

+ 0 - 1
src/themes/_theme.scss

@@ -212,7 +212,6 @@
           justify-content: center;
 
           .loading-text {
-            font-size: 2rem;
             margin-right: 6px;
           }