[diffoscope] 04/06: presenters: html: diffcontrol UI tweaks
Ximin Luo
infinity0 at debian.org
Mon Jul 3 18:35:58 UTC 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch WIP/humungous-diffs
in repository diffoscope.
commit 534c6375d79b1eec36d1995747f6247892dac4a4
Author: Ximin Luo <infinity0 at debian.org>
Date: Mon Jun 19 23:07:20 2017 +0200
presenters: html: diffcontrol UI tweaks
- Don't toggle buttons for diffs that haven't been loaded yet
- Make the diffcontrol headers clickable
---
diffoscope/presenters/html/templates.py | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/diffoscope/presenters/html/templates.py b/diffoscope/presenters/html/templates.py
index d077ad5..595bc58 100644
--- a/diffoscope/presenters/html/templates.py
+++ b/diffoscope/presenters/html/templates.py
@@ -125,6 +125,13 @@ HEADER = """<!DOCTYPE html>
cursor: pointer;
display: none; /* currently, only available in html-dir output where jquery is enabled */
}
+ .diffoscope .diffheader {
+ cursor: pointer;
+ }
+ .diffoscope .diffheader:hover .diffcontrol {
+ color: #080;
+ font-weight: bold;
+ }
.diffoscope .diffcontrol-double {
line-height: 250%%;
}
@@ -177,15 +184,15 @@ $(function() {
$(".ondemand-details").on('click', load_generic("div.difference > *"));
// activate [+]/[-] controls
var diffcontrols = $(".diffcontrol");
- diffcontrols.on('click', function(evt) {
- var control = $(this);
+ $(".diffheader").on('click', function(evt) {
+ var control = $(this).find(".diffcontrol");
var parent = control.parent();
var target = parent.siblings('table.diff, div.difference, div.comment');
var orig = target;
if (evt.shiftKey) {
var gparent = parent.parent();
- control = gparent.find('.diffcontrol');
- target = gparent.find('table.diff, div.difference, div.comment');
+ target = gparent.find('table.diff, div.comment, div.difference');
+ control = target.parent().not(gparent).find('.diffcontrol');
}
if (orig.is(":visible")) {
target.hide();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the Reproducible-commits
mailing list