Commit 98366f3d authored by Aron Carroll's avatar Aron Carroll

Inject cross frame constructors into CF service

parent 553836a8
......@@ -34,8 +34,8 @@ class CrossFrameBridge
channel = this._buildChannel channelOptions
# Attach channel message listeners
for method, callback of @channelListeners
channel.bind method, callback
for own method, callback of @channelListeners
channel.bind method, callback
# Store the newly created channel in our collection
@links.push
......@@ -107,3 +107,6 @@ class CrossFrameBridge
(options.origin.match /^resource:\/\//)
options = $.extend {}, options, {origin: '*'}
channel = Channel.build(options)
if typeof angular != 'undefined'
angular.module('h').value('CrossFrameBridge', CrossFrameBridge)
......@@ -106,3 +106,6 @@ class CrossFrameDiscovery
@requestInProgress = false # value should not actually matter anymore.
discovered = true
return {reply: reply, discovered: discovered, token: token}
if typeof angular != 'undefined'
angular.module('h').value('CrossFrameDiscovery', CrossFrameDiscovery)
......@@ -2,8 +2,16 @@
class CrossFrameService
providers: null
this.inject = ['$rootScope', '$document', '$window', 'store', 'annotationUI']
constructor: ($rootScope, $document, $window, store, annotationUI) ->
this.inject = [
'$rootScope', '$document', '$window', 'store', 'annotationUI'
'CrossFrameDiscovery', 'CrossFrameBridge',
'AnnotationSync', 'AnnotationUISync'
]
constructor: (
$rootScope, $document, $window, store, annotationUI
CrossFrameDiscovery, CrossFrameBridge,
AnnotationSync, AnnotationUISync
) ->
@providers = []
createDiscovery = ->
......
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