@@ -1525,6 +1525,13 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi
15251525 var self = this ;
15261526
15271527 self . update = function ( cmd , diffOpts , file , mode ) {
1528+ if ( cmd || diffOpts || file || mode ) {
1529+ // if new input, update all
1530+ this . cmd = cmd
1531+ this . diffOpts = diffOpts
1532+ this . file = file
1533+ this . mode = mode
1534+ }
15281535 gitApplyType = mode ;
15291536 $ ( ".diff-stage" , self . element ) . attr ( "style" , "display:none" ) ;
15301537 $ ( ".diff-cancel" , self . element ) . attr ( "style" , "display:none" ) ;
@@ -1576,6 +1583,10 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi
15761583 }
15771584 } ;
15781585
1586+ self . reRun = function ( ) {
1587+ self . update ( this . cmd , this . diffOpts , this . file , this . mode )
1588+ }
1589+
15791590 self . refresh = function ( diff ) {
15801591 self . currentDiff = diff ;
15811592 self . diffHeader = "" ;
@@ -1789,24 +1800,24 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi
17891800
17901801 self . addContext = function ( ) {
17911802 self . context += 3 ;
1792- self . update ( ) ;
1803+ self . reRun ( ) ;
17931804 }
17941805
17951806 self . removeContext = function ( ) {
17961807 if ( self . context > 3 ) {
17971808 self . context -= 3 ;
1798- self . update ( ) ;
1809+ self . reRun ( ) ;
17991810 }
18001811 }
18011812
18021813 self . allContext = function ( ) {
18031814 self . complete = ! self . complete ;
1804- self . update ( ) ;
1815+ self . reRun ( ) ;
18051816 }
18061817
18071818 self . toggleIgnoreWhitespace = function ( ) {
18081819 self . ignoreWhitespace = ! self . ignoreWhitespace ;
1809- self . update ( ) ;
1820+ self . reRun ( ) ;
18101821 }
18111822
18121823 self . handleClick = function ( event ) {
0 commit comments