Browse Source

Fixed hide loading bug when canceling the request (#6080)

文翼 3 years ago
parent
commit
5449f35c3d
2 changed files with 9 additions and 3 deletions
  1. 3 1
      src/bootstrap-table.js
  2. 6 2
      src/extensions/pipeline/bootstrap-table-pipeline.js

+ 3 - 1
src/bootstrap-table.js

@@ -2012,7 +2012,9 @@ class BootstrapTable {
         }
         this.load(data)
         this.trigger('load-error', jqXHR && jqXHR.status, jqXHR)
-        if (!silent) this.$tableLoading.hide()
+        if (!silent) {
+          this.hideLoading()
+        }
       }
     })
 

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

@@ -300,7 +300,9 @@ BootstrapTable.prototype.initServer = function (silent, query, url) {
       }
       self.load(res)
       self.trigger('load-success', res)
-      if (!silent) self.$tableLoading.hide()
+      if (!silent) {
+        self.hideLoading()
+      }
     },
     error (res) {
       let data = []
@@ -312,7 +314,9 @@ BootstrapTable.prototype.initServer = function (silent, query, url) {
       }
       self.load(data)
       self.trigger('load-error', res.status, res)
-      if (!silent) self.$tableLoading.hide()
+      if (!silent) {
+        self.hideLoading()
+      }
     }
   })