#52 new
Brian O

#lightbox panels get no IDs

Reported by Brian O | April 22nd, 2010 @ 01:45 PM

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

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.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Nitrogen Web Framework for Erlang

People watching this ticket

Pages