libs/cbi: auto-hide apply messages and make title and description optional for Map and SimpleForm instances

This commit is contained in:
Jo-Philipp Wich 2009-11-09 00:33:45 +00:00
parent 5c4cd0c4d6
commit 6965f4ac2b
2 changed files with 11 additions and 5 deletions

View file

@ -14,10 +14,10 @@ $Id$
-%> -%>
<div class="cbi-map" id="cbi-<%=self.config%>"> <div class="cbi-map" id="cbi-<%=self.config%>">
<h2><a id="content" name="content"><%=self.title%></a></h2> <% if self.title and #self.title > 0 then %><h2><a id="content" name="content"><%=self.title%></a></h2><% end %>
<div class="cbi-map-descr"><%=self.description%></div> <% if self.description and #self.description > 0 then %><div class="cbi-map-descr"><%=self.description%></div><% end %>
<%- if self._apply then -%> <%- if self._apply then -%>
<fieldset class="cbi-section"> <fieldset class="cbi-section" id="cbi-apply-<%=self.config%>">
<legend><%:Applying changes%></legend> <legend><%:Applying changes%></legend>
<ul class="cbi-apply"><%- <ul class="cbi-apply"><%-
local fp = self._apply() local fp = self._apply()
@ -30,6 +30,12 @@ $Id$
fp:close() fp:close()
-%></ul> -%></ul>
</fieldset> </fieldset>
<script type="text/javascript">
window.setTimeout(function() {
var e = document.getElementById('cbi-apply-<%=self.config%>');
if(e) e.style.display = 'none';
}, 750);
</script>
<%- end -%> <%- end -%>
<%- self:render_children() %> <%- self:render_children() %>
<br /> <br />

View file

@ -20,8 +20,8 @@ $Id$
</div> </div>
<% end %> <% end %>
<div class="cbi-map" id="cbi-<%=self.config%>"> <div class="cbi-map" id="cbi-<%=self.config%>">
<h2><a id="content" name="content"><%=self.title%></a></h2> <% if self.title and #self.title > 0 then %><h2><a id="content" name="content"><%=self.title%></a></h2><% end %>
<div class="cbi-map-descr"><%=self.description%></div> <% if self.description and #self.description > 0 then %><div class="cbi-map-descr"><%=self.description%></div><% end %>
<% self:render_children() %> <% self:render_children() %>
<br /> <br />
</div> </div>