Merge pull request #39 from ONLYOFFICE/feature/set-history-data
Feature/set history data
This commit is contained in:
commit
a4a2ec003a
|
@ -163,19 +163,27 @@ define([
|
|||
if (historyStore && data!==null) {
|
||||
var rev, revisions = historyStore.findRevisions(data.version),
|
||||
urlGetTime = new Date();
|
||||
var diff = opts.data.urlDiff || opts.data.changesUrl;
|
||||
var diff = opts.data.changesUrl,
|
||||
url = (!_.isEmpty(diff) && opts.data.previous) ? opts.data.previous.url : opts.data.url,
|
||||
docId = opts.data.key ? opts.data.key : this.currentDocId,
|
||||
docIdPrev = opts.data.previous && opts.data.previous.key ? opts.data.previous.key : this.currentDocIdPrev;
|
||||
|
||||
if (revisions && revisions.length>0) {
|
||||
for(var i=0; i<revisions.length; 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('urlGetTime', urlGetTime, {silent: true});
|
||||
if (opts.data.key) {
|
||||
rev.set('docId', docId, {silent: true});
|
||||
rev.set('docIdPrev', docIdPrev, {silent: true});
|
||||
}
|
||||
}
|
||||
}
|
||||
var hist = new Asc.asc_CVersionHistory();
|
||||
hist.asc_setUrl(opts.data.url);
|
||||
hist.asc_setUrl(url);
|
||||
hist.asc_setUrlChanges(diff);
|
||||
hist.asc_setDocId(_.isEmpty(diff) ? this.currentDocId : this.currentDocIdPrev);
|
||||
hist.asc_setDocId(_.isEmpty(diff) ? docId : docIdPrev);
|
||||
hist.asc_setCurrentChangeId(this.currentChangeId);
|
||||
hist.asc_setArrColors(this.currentArrColors);
|
||||
this.api.asc_showRevision(hist);
|
||||
|
|
Loading…
Reference in a new issue