From a3b9f73fba7d37bcfb971ccafd364bcb348a4ed1 Mon Sep 17 00:00:00 2001 From: David Botton Date: Fri, 24 Dec 2021 01:08:45 -0500 Subject: [PATCH] better handling of multile styles --- source/clog-element.lisp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/source/clog-element.lisp b/source/clog-element.lisp index a38fd38..4a0c195 100644 --- a/source/clog-element.lisp +++ b/source/clog-element.lisp @@ -126,15 +126,14 @@ must be in DOM, ie placed or auto-placed.")) (:documentation "Set css styles using a list of list of name value pairs.")) (defmethod set-styles ((obj clog-element) style-list) - (jquery-execute obj (format nil "css({~{~A~}})" - (mapcar - (lambda (n) - (if n - (format nil "'~A':'~A'," - (first n) - (second n)) - "")) - style-list)))) + (jquery-execute obj (format nil "css({~{~A~^,~}})" + (remove nil (mapcar + (lambda (n) + (when n + (format nil "'~A':'~A'" + (first n) + (second n)))) + style-list))))) ;;;;;;;;;;;;;;; ;; attribute ;;