Fix timeslider revision not changing in most cases
parent
e34a4ea4ee
commit
bb21759d78
|
@ -384,22 +384,10 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
|
|||
}
|
||||
if (changeset) applyChangeset(changeset, path.rev, true, timeDelta);
|
||||
|
||||
|
||||
if (BroadcastSlider.getSliderLength() > 10000)
|
||||
{
|
||||
var start = (Math.floor((newRevision) / 10000) * 10000); // revision 0 to 10
|
||||
changesetLoader.queueUp(start, 100);
|
||||
}
|
||||
|
||||
if (BroadcastSlider.getSliderLength() > 1000)
|
||||
{
|
||||
var start = (Math.floor((newRevision) / 1000) * 1000); // (start from -1, go to 19) + 1
|
||||
changesetLoader.queueUp(start, 10);
|
||||
}
|
||||
|
||||
start = (Math.floor((newRevision) / 100) * 100);
|
||||
|
||||
changesetLoader.queueUp(start, 1, update);
|
||||
// Loading changeset history for new revision
|
||||
loadChangesetsForRevision(newRevision, update);
|
||||
// Loading changeset history for old revision (to make diff between old and new revision)
|
||||
loadChangesetsForRevision(padContents.currentRevision - 1);
|
||||
}
|
||||
|
||||
var authors = _.map(padContents.getActiveAuthors(), function(name){
|
||||
|
@ -408,6 +396,24 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
|
|||
BroadcastSlider.setAuthors(authors);
|
||||
}
|
||||
|
||||
function loadChangesetsForRevision(revision, callback) {
|
||||
if (BroadcastSlider.getSliderLength() > 10000)
|
||||
{
|
||||
var start = (Math.floor((revision) / 10000) * 10000); // revision 0 to 10
|
||||
changesetLoader.queueUp(start, 100);
|
||||
}
|
||||
|
||||
if (BroadcastSlider.getSliderLength() > 1000)
|
||||
{
|
||||
var start = (Math.floor((revision) / 1000) * 1000); // (start from -1, go to 19) + 1
|
||||
changesetLoader.queueUp(start, 10);
|
||||
}
|
||||
|
||||
start = (Math.floor((revision) / 100) * 100);
|
||||
|
||||
changesetLoader.queueUp(start, 1, callback);
|
||||
}
|
||||
|
||||
changesetLoader = {
|
||||
running: false,
|
||||
resolved: [],
|
||||
|
@ -482,7 +488,7 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
|
|||
var astart = start + i * granularity - 1; // rev -1 is a blank single line
|
||||
var aend = start + (i + 1) * granularity - 1; // totalRevs is the most recent revision
|
||||
if (aend > data.actualEndNum - 1) aend = data.actualEndNum - 1;
|
||||
debugLog("adding changeset:", astart, aend);
|
||||
//debugLog("adding changeset:", astart, aend);
|
||||
var forwardcs = Changeset.moveOpsToNewPool(data.forwardsChangesets[i], pool, padContents.apool);
|
||||
var backwardcs = Changeset.moveOpsToNewPool(data.backwardsChangesets[i], pool, padContents.apool);
|
||||
revisionInfo.addChangeset(astart, aend, forwardcs, backwardcs, data.timeDeltas[i]);
|
||||
|
|
Loading…
Reference in New Issue