氮:更改 targetID 会破坏灯箱
我正在使用氮气和灯箱。在花了太长时间试图理解为什么一旦我更改灯箱的 targetID
后,工作示例就会中断,我正在寻找一些指导。如果我使用 "name_dialog"
或 "share_dialog"
,下面的片段有效,但如果我使用 "compose_dialog"
,则无效。我已经查看了源代码和样式表,但没有发现这两者的定义与我想要做的有任何不同。
在我的 .hrl 中:
...
-record (compose_dialog, { ?ELEMENT_BASE(compose_dialog_element) }).
..
在我的元素模块中:
...
reflect() -> record_info(fields, compose_dialog).
render_element(_HtmlID, _Record) ->
#lightbox { id=compose_lightbox, style="display: none;", body = [
..
show() ->
wf:wire(compose_lightbox, #show {}).
I'm using Nitrogen & lightbox. I'm looking for some guidance after spending way too long trying to understand why a working example breaks as soon as I change the targetID
of a lightbox. The fragment below works if I use "name_dialog"
or "share_dialog"
, but not if I use "compose_dialog"
. I've looked through the source and style sheets, but have not found where those two are defined any differently than what I'm trying to do.
In my .hrl:
...
-record (compose_dialog, { ?ELEMENT_BASE(compose_dialog_element) }).
..
In my element module:
...
reflect() -> record_info(fields, compose_dialog).
render_element(_HtmlID, _Record) ->
#lightbox { id=compose_lightbox, style="display: none;", body = [
..
show() ->
wf:wire(compose_lightbox, #show {}).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧——对于任何遇到同样 NOOB 错误的人...
我忽略的是将我的新元素添加到 webview 的正文中。结果,我得到了一个没有 ID 的未定义对象。将其添加到此处(并确保不创建重复项)修复了此错误。
ok -- for anyone running into the same NOOB error...
What I neglected to do was add my new element on the body in webview. As a result, I had an undefined object with no ID. Adding it there (and making sure not to create duplicates) fixed this error.