#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
-
Brian O May 3rd, 2010 @ 04:59 PM
This should be fixed in changeset 6443d7388be122f2e7dbba01d5b1701542e3c5fc
-
Rusty Klophaus June 29th, 2010 @ 08:00 PM
- Milestone cleared.
- Milestone order changed from 0 to 0
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.
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