fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Show active users.
[redakcja.git]
/
src
/
redakcja
/
static
/
js
/
wiki
/
dialog_revert.js
diff --git
a/src/redakcja/static/js/wiki/dialog_revert.js
b/src/redakcja/static/js/wiki/dialog_revert.js
index
4d550f9
..
2af642e
100644
(file)
--- a/
src/redakcja/static/js/wiki/dialog_revert.js
+++ b/
src/redakcja/static/js/wiki/dialog_revert.js
@@
-4,26
+4,25
@@
*/
(function($) {
*/
(function($) {
- function RevertDialog(element, options) {
- this.ctx = $.wiki.exitContext();
- this.clearForm();
+ class RevertDialog extends $.wiki.cls.GenericDialog {
+ constructor(element, options) {
+ let ctx = $.wiki.exitContext();
+ super(element);
+ this.ctx = ctx;
+ this.clearForm();
- /* fill out hidden fields */
- this.$form = $('form', element);
+
/* fill out hidden fields */
+
this.$form = $('form', element);
- $("input[name='textrevert-revision']", this.$form).val(options.revision);
+ $("input[name='textrevert-revision']", this.$form).val(options.revision);
+ }
- $.wiki.cls.GenericDialog.call(this, element);
- };
+ cancelAction() {
+ $.wiki.enterContext(this.ctx);
+ this.hide();
+ };
- RevertDialog.prototype = new $.wiki.cls.GenericDialog();
-
- RevertDialog.prototype.cancelAction = function() {
- $.wiki.enterContext(this.ctx);
- this.hide();
- };
-
- RevertDialog.prototype.revertAction = function() {
+ revertAction() {
var self = this;
self.$elem.block({
var self = this;
self.$elem.block({
@@
-33,7
+32,6
@@
$.wiki.blocking = self.$elem;
try {
$.wiki.blocking = self.$elem;
try {
-
CurrentDocument.revertToVersion({
form: self.$form,
success: function(e, msg) {
CurrentDocument.revertToVersion({
form: self.$form,
success: function(e, msg) {
@@
-58,7
+56,8
@@
console.log('Exception:', e)
self.$elem.unblock();
}
console.log('Exception:', e)
self.$elem.unblock();
}
- }; /* end of revert dialog */
+ }
+ }
/* make it global */
$.wiki.cls.RevertDialog = RevertDialog;
/* make it global */
$.wiki.cls.RevertDialog = RevertDialog;