Adminlte: js error when use boxRefresh

Created on 18 Dec 2017  路  5Comments  路  Source: ColorlibHQ/AdminLTE

Issue type:

  • [ ] Feature request
  • [x] Bug report
  • [ ] Documentation

Environment:

  • AdminLTE Version: 2.4.2
  • Operating System: Windows 10 16299 x64
  • Browser (Version): Chrome 63.0.3239.108

Description:

when i use $.boxRefresh like below

<div class="box box-primary" data-source="/manage?action=request" data-type="horizontalBar">
  <div class="box-header with-border">
    <i class="fa fa-bar-chart"></i>
    <h3 class="box-title">Chart</h3>
    <div class="box-tools pull-right">
      <a class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></a>
      <a class="btn btn-box-tool refresh-btn"><i class="fa fa-refresh"></i></a>
    </div>
  </div>
  <div class="box-body">
    <div class="chart-responsive"><canvas></canvas></div>
  </div>
</div>
<script type="text/javascript">
$(document).ready(function() {
  $('.box[data-source]').boxRefresh({
    loadInContent: false,
    responseType: 'json',
    onLoadDone: function(data) {
      console.log(data);
    }
  })
 })
</script>

i got Uncaught TypeError: b.replace is not a function
at Function.ga.matchesSelector (jquery.min.js:2)
at Function.r.filter (jquery.min.js:2)
at Ka (jquery.min.js:3)
at r.fn.init.remove (jquery.min.js:3)
at f._removeOverlay (adminlte.min.js:14)
at f. (adminlte.min.js:14)
at i (jquery.min.js:2)
at Object.fireWith [as resolveWith] (jquery.min.js:2)
at A (jquery.min.js:4)
at XMLHttpRequest. (jquery.min.js:4)

it seems that Overlay is not work

Most helpful comment

I found the same error. The call to .remove is not correct. I changed the adminlte.js function

f.prototype._removeOverlay = function() { a(this.element).remove(this.$overlay) }

to the following:

f.prototype._removeOverlay = function() { a(this.$overlay).remove() }

All 5 comments

I found the same error. The call to .remove is not correct. I changed the adminlte.js function

f.prototype._removeOverlay = function() { a(this.element).remove(this.$overlay) }

to the following:

f.prototype._removeOverlay = function() { a(this.$overlay).remove() }

@camweir 's fix worked here as well. Many Thanks!!! 馃憤

Hi, I just open new Issue #1976 'cause the error (and more in the same plugin) is not yet repaired in the last version. I hope it can help.

Hi again! After some days of testing, I just open pull request #1981.
After pulling, this issue could be closed.

Hi! The request #1981 just pulled, this issue should be closed, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lenamtl picture lenamtl  路  3Comments

RaruRv picture RaruRv  路  3Comments

tester10 picture tester10  路  3Comments

gaea44 picture gaea44  路  3Comments

jrlooney picture jrlooney  路  3Comments