Browse Source

Fix unload in load API

pull/116/merge
Masayuki Tanaka 11 years ago
parent
commit
c1d037e5ac
  1. 5
      c3.js
  2. 2
      c3.min.js

5
c3.js

@ -3459,6 +3459,9 @@
if (typeof done !== 'function') {
done = function () {};
}
// filter existing target
targetIds = targetIds.filter(function (id) { return hasTarget(id); });
// If no target, call done and return
if (!targetIds || targetIds.length === 0) {
done();
return;
@ -3757,7 +3760,7 @@
// unload if needed
if ('unload' in args) {
// TODO: do not unload if target will load (included in url/rows/columns)
unload(args.unload ? typeof args.unload === 'string' ? [args.unload] : args.unload : [], function () {
unload(typeof args.unload === 'string' ? [args.unload] : typeof args.unload === 'boolean' && args.unload ? getTargetIds() : args.unload, function () {
loadFromArgs(args);
});
} else {

2
c3.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save