browser/app/app.js
// applyWrap iterates over all lines and resizes them to fit wrapped contents
applyWrap iterates over all lines and resizes them to fit wrapped contents
applyWrap iterates over all lines and resizes them to fit wrapped contents
applyWrap() {
    let diffs = document.querySelectorAll(".diff-pane-contents");
    if (diffs.length == 0) {
      return;
    }
    let left = diffs[0].querySelectorAll('.line');
    let right = diffs[1].querySelectorAll('.line');
    let leftGutter = document.querySelectorAll("#gutter-left .line");
    let rightGutter = document.querySelectorAll("#gutter-right .line");
    for (var i = 0; i < left.length; i++) {
      let ll = left[i];
      let rl = right[i];
      let lg = leftGutter[i];
      let rg = rightGutter[i];
      if (!this.wrapLines()) {
        ll.style.whiteSpace = 'pre';
        rl.style.whiteSpace = 'pre';
        ll.style.height = '';
        rl.style.height = '';
        lg.style.height = '';
        rg.style.height = '';
      } else {
        ll.style.whiteSpace = 'pre-wrap';
        rl.style.whiteSpace = 'pre-wrap';
        ll.style.height = 'auto';
        rl.style.height = 'auto';
        let h = Math.max(ll.offsetHeight, rl.offsetHeight, 16);
        ll.style.height = h + 'px';
        rl.style.height = h + 'px';
        lg.style.height = h + 'px';
        rg.style.height = h + 'px';
      }
    }
  }
applyWrap ( ) { let diffs = document . querySelectorAll ( ".diff-pane-contents" ) ; if ( diffs . length == 0 ) { return ; } let left = diffs [ 0 ] . querySelectorAll ( '.line' ) ; let right = diffs [ 1 ] . querySelectorAll ( '.line' ) ; let leftGutter = document . querySelectorAll ( "#gutter-left .line" ) ; let rightGutter = document . querySelectorAll ( "#gutter-right .line" ) ; for ( var i = 0 ; i < left . length ; i ++ ) { let ll = left [ i ] ; let rl = right [ i ] ; let lg = leftGutter [ i ] ; let rg = rightGutter [ i ] ; if ( ! this . wrapLines ( ) ) { ll . style . whiteSpace = 'pre' ; rl . style . whiteSpace = 'pre' ; ll . style . height = '' ; rl . style . height = '' ; lg . style . height = '' ; rg . style . height = '' ; } else { ll . style . whiteSpace = 'pre-wrap' ; rl . style . whiteSpace = 'pre-wrap' ; ll . style . height = 'auto' ; rl . style . height = 'auto' ; let h = Math . max ( ll . offsetHeight , rl . offsetHeight , 16 ) ; ll . style . height = h + 'px' ; rl . style . height = h + 'px' ; lg . style . height = h + 'px' ; rg . style . height = h + 'px' ; } } }
applyWrap iterates over all lines and resizes them to fit wrapped contents
applyWrap iterates over all lines and resizes them to fit wrapped contents