mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-12 16:33:32 -05:00
40 lines
922 B
CoffeeScript
40 lines
922 B
CoffeeScript
|
define [
|
||
|
"utils/Modal"
|
||
|
"libs/backbone"
|
||
|
], (Modal) ->
|
||
|
HistoryView = Backbone.View.extend
|
||
|
template : $("#revisionAreaTemplate").html()
|
||
|
|
||
|
events :
|
||
|
"click #enableVersioning" : "enableVersioning"
|
||
|
"click #take-snapshot" : "takeSnapshot"
|
||
|
|
||
|
render : ->
|
||
|
@$el.html(@template)
|
||
|
return this
|
||
|
|
||
|
setHistoryAreaToDisplayHistory: ->
|
||
|
@$("#historyAreaWrapper").show()
|
||
|
@$("#enableVersioningMessage").hide()
|
||
|
|
||
|
setHistoryAreaToDisplayEnableVersioning: ->
|
||
|
@$("#historyAreaWrapper").hide()
|
||
|
@$("#enableVersioningMessage").show()
|
||
|
|
||
|
enableVersioning: -> @options.manager.enableVersioning()
|
||
|
|
||
|
takeSnapshot: ->
|
||
|
Modal.createModal
|
||
|
title: "Snapshot comment"
|
||
|
message: $("#snapshotCommentTemplate").html()
|
||
|
buttons: [{
|
||
|
text: "Cancel"
|
||
|
},{
|
||
|
text: "Take Snapshot"
|
||
|
class: "btn-primary"
|
||
|
callback: () =>
|
||
|
@options.manager.takeSnapshot(
|
||
|
$("#snapshotComment").val()
|
||
|
)
|
||
|
}]
|