From b3f96efb33d7fc99500147d336ead1536b6b24e9 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Sun, 26 Oct 2014 22:25:29 +0200 Subject: introduce signal, start using in history; use consts for signal name introduces two new modules: scripts/consts.js scripts/signal.js signal is a thin wrapper for jquery('window').on and jquery('window').trigger, which seems like an adaquete signal library - there are faster things around, but why introduce another dependency. --- scripts/rhizicore.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'scripts/rhizicore.js') diff --git a/scripts/rhizicore.js b/scripts/rhizicore.js index cdffde64..1b4bcbb3 100644 --- a/scripts/rhizicore.js +++ b/scripts/rhizicore.js @@ -1,8 +1,8 @@ "use strict" define('rhizicore', -['jquery', 'd3', 'util', 'history', 'textanalysis'], -function($, d3, util, history, textanalysis) { +['jquery', 'd3', 'consts', 'signal', 'util', 'history', 'textanalysis'], +function($, d3, consts, signal, util, history, textanalysis) { var History = history.History; var addednodes = []; @@ -260,9 +260,7 @@ function myGraph(el) { "state": state }; links.push(link); - if (this.history !== undefined) { - this.history.record_links([link]); - } + signal.signal(consts.RECORD_LINKS, [[link]]); } else { found.name = name; found.state = state; -- cgit v1.3.1