Commit 964cb82322e65c807382c6a84eba0a8e21c1c70f
Don't show comment links when we don't have the context to generate one
cel committed on 1/11/2018, 7:27:09 AMParent: f34f08104b9613ba5f0ac43eb229ae992116224a
Files changed
lib/serve.js | changed |
lib/serve.js | ||
---|---|---|
@@ -2692,17 +2692,23 @@ | ||
2692 | 2692 … | pull.map(function (line) { |
2693 | 2693 … | var lineNum = i++ |
2694 | 2694 … | var id = hash + '-' + lineNum |
2695 | 2695 … | var idEnc = encodeURIComponent(id) |
2696 … | + var allowComment = self.query.commit && self.query.path | |
2696 | 2697 … | return [ |
2697 | 2698 … | ph('tr', [ |
2699 … | + ph('td', | |
2700 … | + allowComment ? ph('a', { | |
2701 … | + href: '?msg=' + encodeURIComponent(self.query.msg) | |
2702 … | + + '&commit=' + encodeURIComponent(self.query.commit) | |
2703 … | + + '&path=' + encodeURIComponent(self.query.path) | |
2704 … | + + '&comment=' + idEnc | |
2705 … | + + '#' + idEnc | |
2706 … | + }, '…') : '' | |
2707 … | + ), | |
2698 | 2708 … | ph('td', ph('a', { |
2699 | 2709 … | name: id, |
2700 | - href: '?msg=' + encodeURIComponent(self.query.msg) | |
2701 | - + '&commit=' + encodeURIComponent(self.query.commit) | |
2702 | - + '&path=' + encodeURIComponent(self.query.path) | |
2703 | - + '&comment=' + idEnc | |
2704 | - + '#' + idEnc | |
2710 … | + href: '#' + idEnc | |
2705 | 2711 … | }, String(lineNum))), |
2706 | 2712 … | ph('td', ph('pre', self.app.render.highlight(line, ext))) |
2707 | 2713 … | ]), |
2708 | 2714 … | lineComments[lineNum] ? ph('tr', |
Built with git-ssb-web