diff --git a/customize.dist/src/less2/include/toolbar-history.less b/customize.dist/src/less2/include/toolbar-history.less index 7538fb2bc..119a82387 100644 --- a/customize.dist/src/less2/include/toolbar-history.less +++ b/customize.dist/src/less2/include/toolbar-history.less @@ -41,6 +41,7 @@ width: 100%; text-align: center; color: black; + left: 0; } .cp-toolbar-history-goto { display: inline-block; diff --git a/www/common/onlyoffice/history.js b/www/common/onlyoffice/history.js index e9f361f36..c8b485efe 100644 --- a/www/common/onlyoffice/history.js +++ b/www/common/onlyoffice/history.js @@ -64,6 +64,8 @@ define([ var fromHash = nextId ? hashes[nextId].hash : config.onlyoffice.lastHash; msgIndex = 0; + + showVersion(); if (ooMessages[id]) { // Cp already loaded: reload OO loading = false; @@ -123,14 +125,28 @@ define([ var $loadMore, $version, get; + var showVersion = function () { + var major = sortedCp.length - cpIndex; + var v = major + '.' + msgIndex; + $version.text("Version " + v); // XXX + + var $pos = $hist.find('.cp-toolbar-history-pos'); + var cps = sortedCp.length; + var id = sortedCp[cps - cpIndex -1] || -1; + if (!ooMessages[id]) { return; } + var msgs = ooMessages[id]; + var p = 100*(msgIndex / (msgs.length-1)); + $pos.css('margin-left', p+'%'); + }; + var $fastPrev = $('