mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-30 04:21:32 +02:00
Use coffeescript => functions, rather than self=this.
This commit is contained in:
@@ -14,29 +14,25 @@ define [
|
||||
@periodicLoadInterval = null
|
||||
|
||||
setTimeout(
|
||||
(self) ->
|
||||
() =>
|
||||
# set up a regular re-load
|
||||
setTimeout(
|
||||
(self) ->
|
||||
self.periodicLoadInterval = setInterval(
|
||||
(self) ->
|
||||
self.loadLabelsFromOpenDoc()
|
||||
() =>
|
||||
@periodicLoadInterval = setInterval(
|
||||
() =>
|
||||
@loadLabelsFromOpenDoc()
|
||||
, AUTOMATIC_REFRESH_PERIOD
|
||||
, self
|
||||
)
|
||||
, AUTOMATIC_REFRESH_PERIOD
|
||||
, self
|
||||
)
|
||||
# listen for document open
|
||||
self.$scope.$on 'document:opened', (e, doc) ->
|
||||
@$scope.$on 'document:opened', (e, doc) =>
|
||||
setTimeout(
|
||||
(self) ->
|
||||
self.scheduleLoadLabelsFromOpenDoc()
|
||||
() =>
|
||||
@scheduleLoadLabelsFromOpenDoc()
|
||||
, 1000
|
||||
, self
|
||||
)
|
||||
, 0
|
||||
this
|
||||
)
|
||||
|
||||
loadLabelsFromOpenDoc: () ->
|
||||
@@ -53,8 +49,8 @@ define [
|
||||
if @loadLabelsTimeout
|
||||
clearTimeout(@loadLabelsTimeout)
|
||||
@loadLabelsTimeout = setTimeout(
|
||||
(self) ->
|
||||
self.loadLabelsFromOpenDoc()
|
||||
() =>
|
||||
@loadLabelsFromOpenDoc()
|
||||
, 1000
|
||||
, this
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user