mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
39 lines
922 B
CoffeeScript
39 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()
|
|
)
|
|
}]
|