|
@@ -14,29 +14,25 @@ define [
|
|
|
@periodicLoadInterval = null
|
|
@periodicLoadInterval = null
|
|
|
|
|
|
|
|
setTimeout(
|
|
setTimeout(
|
|
|
- (self) ->
|
|
|
|
|
|
|
+ () =>
|
|
|
# set up a regular re-load
|
|
# set up a regular re-load
|
|
|
setTimeout(
|
|
setTimeout(
|
|
|
- (self) ->
|
|
|
|
|
- self.periodicLoadInterval = setInterval(
|
|
|
|
|
- (self) ->
|
|
|
|
|
- self.loadLabelsFromOpenDoc()
|
|
|
|
|
|
|
+ () =>
|
|
|
|
|
+ @periodicLoadInterval = setInterval(
|
|
|
|
|
+ () =>
|
|
|
|
|
+ @loadLabelsFromOpenDoc()
|
|
|
, AUTOMATIC_REFRESH_PERIOD
|
|
, AUTOMATIC_REFRESH_PERIOD
|
|
|
- , self
|
|
|
|
|
)
|
|
)
|
|
|
, AUTOMATIC_REFRESH_PERIOD
|
|
, AUTOMATIC_REFRESH_PERIOD
|
|
|
- , self
|
|
|
|
|
)
|
|
)
|
|
|
# listen for document open
|
|
# listen for document open
|
|
|
- self.$scope.$on 'document:opened', (e, doc) ->
|
|
|
|
|
|
|
+ @$scope.$on 'document:opened', (e, doc) =>
|
|
|
setTimeout(
|
|
setTimeout(
|
|
|
- (self) ->
|
|
|
|
|
- self.scheduleLoadLabelsFromOpenDoc()
|
|
|
|
|
|
|
+ () =>
|
|
|
|
|
+ @scheduleLoadLabelsFromOpenDoc()
|
|
|
, 1000
|
|
, 1000
|
|
|
- , self
|
|
|
|
|
)
|
|
)
|
|
|
, 0
|
|
, 0
|
|
|
- this
|
|
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
loadLabelsFromOpenDoc: () ->
|
|
loadLabelsFromOpenDoc: () ->
|
|
@@ -53,8 +49,8 @@ define [
|
|
|
if @loadLabelsTimeout
|
|
if @loadLabelsTimeout
|
|
|
clearTimeout(@loadLabelsTimeout)
|
|
clearTimeout(@loadLabelsTimeout)
|
|
|
@loadLabelsTimeout = setTimeout(
|
|
@loadLabelsTimeout = setTimeout(
|
|
|
- (self) ->
|
|
|
|
|
- self.loadLabelsFromOpenDoc()
|
|
|
|
|
|
|
+ () =>
|
|
|
|
|
+ @loadLabelsFromOpenDoc()
|
|
|
, 1000
|
|
, 1000
|
|
|
, this
|
|
, this
|
|
|
)
|
|
)
|