Commit febc692b authored by Gerben's avatar Gerben Committed by Aron Carroll

Small fixes

parent a161abcc
......@@ -28,7 +28,7 @@ class AnnotationSync
# association of annotations received in arguments to window-local copies.
cache: null
constructor: (options, bridge) ->
constructor: (options, @bridge) ->
@options = $.extend(true, {}, @options, options)
@cache = {}
......@@ -41,13 +41,13 @@ class AnnotationSync
this._on(event, handler)
# Register remotely invokable methods
for method, func in @_channelListeners
bridge.on(method, func)
for method, func of @_channelListeners
@bridge.on(method, func)
# Upon new connections, send over the items in our cache
onConnect = (channel) =>
this._syncCache(channel)
bridge.onConnect(onConnect)
@bridge.onConnect(onConnect)
getAnnotationForTag: (tag) ->
@cache[tag] or null
......
......@@ -84,15 +84,15 @@ class CrossFrameBridge
return
on: (method, callback) ->
@channelListeners[event] = callback
@channelListeners[method] = callback
for l in @links
l.channel.bind event, callback
l.channel.bind method, callback
return this
off: (method) ->
for l in @links
l.channel.unbind event
delete @channelListeners[event]
l.channel.unbind method
delete @channelListeners[method]
return this
# Add a function to be called upon a new connection
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment