- restoreVersion: function(options) {
- if(options.version && options.description) {
- sandbox.publish('restoringStarted', {version: options.version});
+ restoreVersion: function(version) {
+ var documentRestoreForm = $.extend({
+ fields: [],
+ version_field_name: 'version'
+ },
+ sandbox.getConfig().documentRestoreForm
+ ),
+ dialog = Dialog.create({
+ fields: documentRestoreForm.fields,
+ title: gettext('Restore Version'),
+ submitButtonText: gettext('Restore')
+ });
+
+ dialog.on('save', function(event) {
+ var formData = event.formData;
+ formData[documentRestoreForm.version_field_name] = version;
+ sandbox.publish('restoringStarted', {version: version});
+ if(sandbox.getConfig().jsonifySentData) {
+ formData = JSON.stringify(formData);
+ }