Skip to content

Commit

Permalink
Force worker bug fix after built
Browse files Browse the repository at this point in the history
  • Loading branch information
pissang committed Jul 22, 2014
1 parent e897bf7 commit 0851dcd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/chart/forceLayoutWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,19 @@ if (typeof(window) === 'undefined' || window !== self) {
return self.tmd.modules[id];
};

self.define = function(id, constructor) {
self.define = function(id, deps, constructor) {
if (arguments.length === 0) {
return;
} else if (arguments.length == 1) {
constructor = id;
// TODO
id = 'ForceLayout';
} else if (arguments.length == 2) {
constructor = deps;
}
// In release environment
// Ugliy polyfill
if (id.indexOf('ForceLayout') >= 0) {
id = 'ForceLayout';
}
self.tmd.modules[id] = constructor(self.tmd.require);
Expand Down

0 comments on commit 0851dcd

Please sign in to comment.