fixed CardRefresh doubled load if loadOnInit is true
This commit is contained in:
17
dist/js/adminlte.js
vendored
17
dist/js/adminlte.js
vendored
@@ -1406,12 +1406,6 @@
|
||||
if (this._settings.source === '') {
|
||||
throw new Error('Source url was not defined. Please specify a url in your CardRefresh source option.');
|
||||
}
|
||||
|
||||
this._init();
|
||||
|
||||
if (this._settings.loadOnInit) {
|
||||
this.load();
|
||||
}
|
||||
}
|
||||
|
||||
var _proto = CardRefresh.prototype;
|
||||
@@ -1459,6 +1453,10 @@
|
||||
$(this).find(this._settings.trigger).on('click', function () {
|
||||
_this.load();
|
||||
});
|
||||
|
||||
if (this._settings.loadOnInit) {
|
||||
this.load();
|
||||
}
|
||||
} // Static
|
||||
;
|
||||
|
||||
@@ -1474,7 +1472,7 @@
|
||||
|
||||
if (typeof config === 'string' && config.match(/load/)) {
|
||||
data[config]();
|
||||
} else if (typeof config === 'object') {
|
||||
} else {
|
||||
data._init($(this));
|
||||
}
|
||||
};
|
||||
@@ -1494,6 +1492,11 @@
|
||||
|
||||
CardRefresh._jQueryInterface.call($(this), 'load');
|
||||
});
|
||||
$(document).ready(function () {
|
||||
$(Selector.DATA_REFRESH).each(function () {
|
||||
CardRefresh._jQueryInterface.call($(this));
|
||||
});
|
||||
});
|
||||
/**
|
||||
* jQuery API
|
||||
* ====================================================
|
||||
|
||||
2
dist/js/adminlte.js.map
vendored
2
dist/js/adminlte.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/js/adminlte.min.js
vendored
2
dist/js/adminlte.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/js/adminlte.min.js.map
vendored
2
dist/js/adminlte.min.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user