Commit 6c7ea6af authored by Julia Radzhabova's avatar Julia Radzhabova

[DE] Changed format for data in setHistoryData.

parent 75a175b4
...@@ -163,19 +163,32 @@ define([ ...@@ -163,19 +163,32 @@ define([
if (historyStore && data!==null) { if (historyStore && data!==null) {
var rev, revisions = historyStore.findRevisions(data.version), var rev, revisions = historyStore.findRevisions(data.version),
urlGetTime = new Date(); urlGetTime = new Date();
var diff = opts.data.urlDiff || opts.data.changesUrl; var diff = opts.data.urlDiff || opts.data.changesUrl,
url, docId;
if (opts.data.current && opts.data.previous) {
url = _.isEmpty(diff) ? opts.data.current.url : opts.data.previous.url;
docId = _.isEmpty(diff) ? opts.data.current.key : opts.data.previous.key;
} else {
url = opts.data.url;
docId = _.isEmpty(diff) ? this.currentDocId : this.currentDocIdPrev;
}
if (revisions && revisions.length>0) { if (revisions && revisions.length>0) {
for(var i=0; i<revisions.length; i++) { for(var i=0; i<revisions.length; i++) {
rev = revisions[i]; rev = revisions[i];
rev.set('url', opts.data.url, {silent: true}); rev.set('url', url, {silent: true});
rev.set('urlDiff', diff, {silent: true}); rev.set('urlDiff', diff, {silent: true});
rev.set('urlGetTime', urlGetTime, {silent: true}); rev.set('urlGetTime', urlGetTime, {silent: true});
if (opts.data.current && opts.data.previous) {
rev.set('docId', opts.data.current.key, {silent: true});
rev.set('docIdPrev', opts.data.previous.key, {silent: true});
}
} }
} }
var hist = new Asc.asc_CVersionHistory(); var hist = new Asc.asc_CVersionHistory();
hist.asc_setUrl(opts.data.url); hist.asc_setUrl(url);
hist.asc_setUrlChanges(diff); hist.asc_setUrlChanges(diff);
hist.asc_setDocId(_.isEmpty(diff) ? this.currentDocId : this.currentDocIdPrev); hist.asc_setDocId(docId);
hist.asc_setCurrentChangeId(this.currentChangeId); hist.asc_setCurrentChangeId(this.currentChangeId);
hist.asc_setArrColors(this.currentArrColors); hist.asc_setArrColors(this.currentArrColors);
this.api.asc_showRevision(hist); this.api.asc_showRevision(hist);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment