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

Small fixes

parent a161abcc
...@@ -28,7 +28,7 @@ class AnnotationSync ...@@ -28,7 +28,7 @@ class AnnotationSync
# association of annotations received in arguments to window-local copies. # association of annotations received in arguments to window-local copies.
cache: null cache: null
constructor: (options, bridge) -> constructor: (options, @bridge) ->
@options = $.extend(true, {}, @options, options) @options = $.extend(true, {}, @options, options)
@cache = {} @cache = {}
...@@ -41,13 +41,13 @@ class AnnotationSync ...@@ -41,13 +41,13 @@ class AnnotationSync
this._on(event, handler) this._on(event, handler)
# Register remotely invokable methods # Register remotely invokable methods
for method, func in @_channelListeners for method, func of @_channelListeners
bridge.on(method, func) @bridge.on(method, func)
# Upon new connections, send over the items in our cache # Upon new connections, send over the items in our cache
onConnect = (channel) => onConnect = (channel) =>
this._syncCache(channel) this._syncCache(channel)
bridge.onConnect(onConnect) @bridge.onConnect(onConnect)
getAnnotationForTag: (tag) -> getAnnotationForTag: (tag) ->
@cache[tag] or null @cache[tag] or null
......
...@@ -84,15 +84,15 @@ class CrossFrameBridge ...@@ -84,15 +84,15 @@ class CrossFrameBridge
return return
on: (method, callback) -> on: (method, callback) ->
@channelListeners[event] = callback @channelListeners[method] = callback
for l in @links for l in @links
l.channel.bind event, callback l.channel.bind method, callback
return this return this
off: (method) -> off: (method) ->
for l in @links for l in @links
l.channel.unbind event l.channel.unbind method
delete @channelListeners[event] delete @channelListeners[method]
return this return this
# Add a function to be called upon a new connection # 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