The #lightbox element does not respect its class attribute. As a
result, it gets no ID set, since the top level panel never gets
passed through render_elements() again. The fix is to set the top
level panel's class to include the class of the lightbox. Here's
the patch:
diff --git a/apps/nitrogen/src/elements/layout/element_lightbox.erl b/apps/nitro
index ff542f1..d02ccf6 100644
--- a/apps/nitrogen/src/elements/layout/element_lightbox.erl
+++ b/apps/nitrogen/src/elements/layout/element_lightbox.erl
@@ -10,9 +10,8 @@ reflect() -> record_info(fields, lightbox).
render_element(Record) ->
Panel = #panel {
- id=Record#lightbox.id,
anchor=Record#lightbox.anchor,
- class=lightbox,
+ class=[lightbox|Record#lightbox.class],
style="position: fixed; top: 0px; left: 0px; bottom: 0px; right: 0px; "
body=[
#panel {
Note that this is related to ticket #51 #container_12{} / #container_16{} ignore class attribute
UPDATE: Please forgive my unfamiliarity with how Nitrogen
handles IDs in classes. I've updated the diff above to add the
"lightbox" class as an atom rather than as a string concatenation.
Besides looking a little cleaner, it makes sure that the rest of
the classes are rendered properly, which they weren't before.