mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-10 06:39:01 +02:00
Merge branch 'master' of https://github.com/sharelatex/web-sharelatex
This commit is contained in:
@@ -24,6 +24,8 @@ define [
|
||||
if oldStatus[doc_id]?
|
||||
newStatus[doc_id] = oldStatus[doc_id]
|
||||
newStatus[doc_id].unsavedSeconds += 1
|
||||
if newStatus[doc_id].unsavedSeconds == 60
|
||||
reportUnsavedChanges(doc)
|
||||
else
|
||||
newStatus[doc_id] = {
|
||||
unsavedSeconds: 0
|
||||
@@ -39,6 +41,12 @@ define [
|
||||
$scope.docSavingStatusCount = newUnsavedCount
|
||||
$scope.$apply()
|
||||
|
||||
reportUnsavedChanges = (doc) ->
|
||||
ide.reportError new Error("unsaved changes"), {
|
||||
inflightOp: doc?.getInflightOp(),
|
||||
pendingOp: doc?.getPendingOp()
|
||||
}
|
||||
|
||||
warnAboutUnsavedChanges = () ->
|
||||
if Document.hasUnsavedChanges()
|
||||
return "You have unsaved changes. If you leave now they will not be saved."
|
||||
|
||||
Reference in New Issue
Block a user