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/history.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts/history.js') diff --git a/scripts/history.js b/scripts/history.js index a3127c75..e99cbb08 100644 --- a/scripts/history.js +++ b/scripts/history.js @@ -15,11 +15,16 @@ // ReferenceError: __commandLineAPI is not defined //var ActionEnum = Enum(); -define('history', ['FileSaver'], function(saveAs) { +define('history', ['jquery', 'FileSaver', 'consts', 'signal'], + function($, saveAs, consts, signal) { function History(user) { + var that = this; this.records = []; this.user = user; + signal.slot(consts.RECORD_LINKS, function(obj) { + return that.record_links(obj) + }); } var ACTION_KEYSTROKES = 'ACTION_KEYSTROKES'; -- cgit v1.3.1