diff --git a/apps/common/main/lib/controller/History.js b/apps/common/main/lib/controller/History.js index b261bc3a5..b3714940d 100644 --- a/apps/common/main/lib/controller/History.js +++ b/apps/common/main/lib/controller/History.js @@ -139,6 +139,12 @@ define([ Common.Gateway.requestHistoryData(rev); // получаем url-ы для ревизий }, 10); } else { + var commentsController = this.getApplication().getController('Common.Controllers.Comments'); + if (commentsController) { + commentsController.onApiHideComment(); + commentsController.clearCollections(); + } + var urlDiff = record.get('urlDiff'), token = record.get('token'), hist = new Asc.asc_CVersionHistory(); @@ -152,11 +158,6 @@ define([ hist.asc_setServerVersion(this.currentServerVersion); this.api.asc_showRevision(hist); - var commentsController = this.getApplication().getController('Common.Controllers.Comments'); - if (commentsController) { - commentsController.onApiHideComment(); - commentsController.clearCollections(); - } var reviewController = this.getApplication().getController('Common.Controllers.ReviewChanges'); if (reviewController) reviewController.onApiShowChange(); @@ -175,6 +176,12 @@ define([ }; Common.UI.alert(config); } else { + var commentsController = this.getApplication().getController('Common.Controllers.Comments'); + if (commentsController) { + commentsController.onApiHideComment(); + commentsController.clearCollections(); + } + var data = opts.data; var historyStore = this.getApplication().getCollection('Common.Collections.HistoryVersions'); if (historyStore && data!==null) { @@ -210,11 +217,6 @@ define([ hist.asc_setServerVersion(this.currentServerVersion); this.api.asc_showRevision(hist); - var commentsController = this.getApplication().getController('Common.Controllers.Comments'); - if (commentsController) { - commentsController.onApiHideComment(); - commentsController.clearCollections(); - } var reviewController = this.getApplication().getController('Common.Controllers.ReviewChanges'); if (reviewController) reviewController.onApiShowChange();