summaryrefslogtreecommitdiff
path: root/src/model/graph.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/graph.js')
-rw-r--r--src/model/graph.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/model/graph.js b/src/model/graph.js
index 6a299b5e..31c8fa32 100644
--- a/src/model/graph.js
+++ b/src/model/graph.js
@@ -9,8 +9,11 @@ function Graph() {
var nodes = [],
links = [],
+ user,
+ userBus = new Bacon.Bus(),
diffBus = new Bacon.Bus();
+ this.userBus = userBus;
this.diffBus = diffBus;
/**
@@ -621,9 +624,12 @@ function Graph() {
}
this.set_user = function(user) {
+ var elem = $('svg g.zoom')[0];
this.user = user;
- this.history = new History(this.user, $('svg g.zoom')[0]);
- console.log('new user: ' + user);
+
+ this.history = new history.History(this.user, this, elem);
+ console.log('new user: ' + this.user);
+ this.userBus.push(this.user);
}
function clear_history() {
@@ -684,6 +690,13 @@ function Graph() {
}
return selected;
}
+
+ user = util.getParameterByName('user');
+ if (user) {
+ var self = this;
+ console.log('setting user from parameter to: ' + user);
+ setTimeout(function() { self.set_user(user); }, 0);
+ }
}
return {