aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-04-26 20:35:20 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-04-26 20:35:20 +0200
commit9f5ce300dbba1948bc3a9cc948829031f873651e (patch)
treec87411a8976326a66136dba9f8861a83c3e82bd5
parentMade .btn own css class. (diff)
downloadcalp-9f5ce300dbba1948bc3a9cc948829031f873651e.tar.gz
calp-9f5ce300dbba1948bc3a9cc948829031f873651e.tar.xz
Move a on event to inside, around body.
-rw-r--r--module/output/html.scm49
-rw-r--r--static/script.js3
2 files changed, 26 insertions, 26 deletions
diff --git a/module/output/html.scm b/module/output/html.scm
index 6b2849ad..6bebcf4d 100644
--- a/module/output/html.scm
+++ b/module/output/html.scm
@@ -179,31 +179,30 @@
(inner x (right-subtree tree))))))
(define* (make-block ev optional: (extra-attributes '()))
- `(a (@ (href "#" ,(UID ev))
- (class "hidelink"))
- (div (@ ,@(assq-merge
- extra-attributes
- `((class "event CAL_" ,(html-attr (or (attr (parent ev) 'NAME)
- "unknown"))
- ,(when (and (attr ev 'PARTSTAT) (string= "TENTATIVE" (attr ev 'PARTSTAT)))
- " tentative"))
- ;; TODO only if in debug mode?
- ,@(data-attributes ev))))
-
- (div (@ (class "event-inner"))
- ;; NOTE These popup's are far from good. Main problem being that
- ;; the often render off-screen for events high up on the screen.
- (div (@ (class "popup"))
- ,(event-debug-html ev))
- (div (@ (class "body"))
- ,(when (attr ev 'RRULE)
- `(span (@ (class "repeating")) "↺"))
- ,((get-config 'summary-filter) ev (attr ev 'SUMMARY))
- ,(when (attr ev 'LOCATION)
- `(span (@ (class "location"))
- ,(string-map (lambda (c) (if (char=? c #\,) #\newline c))
- (attr ev 'LOCATION))))
- )))) )
+ `(div (@ ,@(assq-merge
+ extra-attributes
+ `((class "event CAL_" ,(html-attr (or (attr (parent ev) 'NAME)
+ "unknown"))
+ ,(when (and (attr ev 'PARTSTAT) (string= "TENTATIVE" (attr ev 'PARTSTAT)))
+ " tentative"))
+ ;; TODO only if in debug mode?
+ ,@(data-attributes ev))))
+ (div (@ (class "event-inner"))
+ ;; NOTE These popup's are far from good. Main problem being that
+ ;; the often render off-screen for events high up on the screen.
+ (div (@ (class "popup"))
+ ,(event-debug-html ev))
+ (a (@ (href "#" ,(UID ev))
+ (class "hidelink"))
+ (div (@ (class "body"))
+ ,(when (attr ev 'RRULE)
+ `(span (@ (class "repeating")) "↺"))
+ ,((get-config 'summary-filter) ev (attr ev 'SUMMARY))
+ ,(when (attr ev 'LOCATION)
+ `(span (@ (class "location"))
+ ,(string-map (lambda (c) (if (char=? c #\,) #\newline c))
+ (attr ev 'LOCATION))))
+ )))) )
;; Format single event for graphical display
(define (create-block date ev)
diff --git a/static/script.js b/static/script.js
index 274bcb86..494b6266 100644
--- a/static/script.js
+++ b/static/script.js
@@ -135,7 +135,7 @@ function new_popup (event) {
// if (event.target !== this) return;
/* popup = this.children[0].children[0] */
- popup = this.parentElement.getElementsByClassName("popup")[0];
+ popup = this.parentElement.parentElement.getElementsByClassName("popup")[0];
popup.classList.toggle("show")
/* x-axis fix */
@@ -204,6 +204,7 @@ window.onload = function () {
days = document.getElementsByClassName("days")[0]
for (let e of days.getElementsByClassName("body")) {
e.onclick = new_popup;
+ e.parentElement.href = "#";
}
// days.scrollLeft == 0