# HG changeset patch # User Alexander Plavin # Date 1378459859 -14400 # Node ID 659bc603bd0d1fa393dd53f8b81d3c046de83826 # Parent fb6e87d939482fb8d7636fa1bc8861a8b34773b7 hgweb: add reset javascript function to Graph It makes the Graph object to be in the same state as just after the initialization. This will help to add infinite scrolling to graph view. diff -r fb6e87d93948 -r 659bc603bd0d mercurial/templates/static/mercurial.js --- a/mercurial/templates/static/mercurial.js Sat Sep 21 21:33:29 2013 +0900 +++ b/mercurial/templates/static/mercurial.js Fri Sep 06 13:30:59 2013 +0400 @@ -36,6 +36,14 @@ this.columns = 0; this.revlink = ''; + this.reset = function() { + this.bg = [0, 4]; + this.cell = [2, 0]; + this.columns = 0; + document.getElementById('nodebgs').innerHTML = ''; + document.getElementById('graphnodes').innerHTML = ''; + } + this.scale = function(height) { this.bg_height = height; this.box_size = Math.floor(this.bg_height / 1.2);