chiark / gitweb /
check-bkp-status.in: Tweak auto-collapse of linked log sections.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 6 Mar 2014 11:58:36 +0000 (11:58 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 6 Mar 2014 12:14:09 +0000 (12:14 +0000)
If a log is manually collapsed then forget it as being the auto-expanded
section so that if it gets manually expanded again then it doesn't get
auto-collapsed.

check-bkp-status.in

index 3e1f71471e83edd9037248829c101b488635646f..5bbbdc2119790f3f95969408c0e7926cf7b7c4d2 100644 (file)
@@ -264,10 +264,11 @@ html_header () {
        function do_hide(d, b) {
          add_elt_class(d, 'hide');
          b.textContent = '[show]';
+         if (LAST_EXPAND !== null && d === LAST_EXPAND[0])
+           LAST_EXPAND = null;
        }
        function expand_log(tag) {
-         if (LAST_EXPAND !== null)
-           do_hide(LAST_EXPAND[0], LAST_EXPAND[1]);
+         if (LAST_EXPAND !== null) do_hide(LAST_EXPAND[0], LAST_EXPAND[1]);
          var d = elt('logdump-' + tag);
          var b = elt('expand-' + tag);
          LAST_EXPAND = [d, b];