+7
-1
@@ -993,7 +993,13 @@
|
||||
return this.screen.model.execute('history_revisions',
|
||||
[ids], this.screen.context)
|
||||
.then(revisions => {
|
||||
new Sao.Window.Revision(revisions, set_revision(revisions));
|
||||
const revision = this.screen.context._datetime;
|
||||
if (revision) {
|
||||
// Remove a millisecond as microseconds are truncated
|
||||
revision.add(-1, 'milliseconds');
|
||||
}
|
||||
new Sao.Window.Revision(
|
||||
revisions, revision, set_revision(revisions));
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
+9
-6
@@ -1083,7 +1083,7 @@
|
||||
});
|
||||
|
||||
Sao.Window.Revision = Sao.class_(Object, {
|
||||
init: function(revisions, callback) {
|
||||
init: function(revisions, revision, callback) {
|
||||
this.callback = callback;
|
||||
var dialog = new Sao.Dialog(
|
||||
Sao.i18n.gettext('Revision'), '', 'lg');
|
||||
@@ -1124,15 +1124,18 @@
|
||||
value: null,
|
||||
text: ''
|
||||
}));
|
||||
for (let revision of revisions) {
|
||||
var name = revision[2];
|
||||
revision = revision[0];
|
||||
for (let rev of revisions) {
|
||||
var name = rev[2];
|
||||
rev = rev[0];
|
||||
this.select.append(jQuery('<option/>', {
|
||||
value: revision.valueOf(),
|
||||
value: rev.valueOf(),
|
||||
text: Sao.common.format_datetime(
|
||||
date_format + ' ' + time_format, revision) + ' ' + name,
|
||||
date_format + ' ' + time_format, rev) + ' ' + name,
|
||||
}));
|
||||
}
|
||||
if (revision) {
|
||||
this.select.val(revision.valueOf());
|
||||
}
|
||||
this.el.modal('show');
|
||||
this.el.on('hidden.bs.modal', function(event) {
|
||||
jQuery(this).remove();
|
||||
|
||||
Reference in New Issue
Block a user