summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-11-09 00:33:45 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-11-09 00:33:45 +0000
commit6965f4ac2b57ef397b65cd30c9a1b7f14daea980 (patch)
tree9ccd54897143541f12b61d0bd646843be4586421
parent5c4cd0c4d6543fa0428b6c7eb5d2c131d29befba (diff)
libs/cbi: auto-hide apply messages and make title and description optional for Map and SimpleForm instances
-rw-r--r--libs/cbi/luasrc/view/cbi/map.htm12
-rw-r--r--libs/cbi/luasrc/view/cbi/simpleform.htm4
2 files changed, 11 insertions, 5 deletions
diff --git a/libs/cbi/luasrc/view/cbi/map.htm b/libs/cbi/luasrc/view/cbi/map.htm
index 861656894..6b6f3e43b 100644
--- a/libs/cbi/luasrc/view/cbi/map.htm
+++ b/libs/cbi/luasrc/view/cbi/map.htm
@@ -14,10 +14,10 @@ $Id$
-%>
<div class="cbi-map" id="cbi-<%=self.config%>">
- <h2><a id="content" name="content"><%=self.title%></a></h2>
- <div class="cbi-map-descr"><%=self.description%></div>
+ <% if self.title and #self.title > 0 then %><h2><a id="content" name="content"><%=self.title%></a></h2><% end %>
+ <% if self.description and #self.description > 0 then %><div class="cbi-map-descr"><%=self.description%></div><% end %>
<%- if self._apply then -%>
- <fieldset class="cbi-section">
+ <fieldset class="cbi-section" id="cbi-apply-<%=self.config%>">
<legend><%:Applying changes%></legend>
<ul class="cbi-apply"><%-
local fp = self._apply()
@@ -30,6 +30,12 @@ $Id$
fp:close()
-%></ul>
</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 -%>
<%- self:render_children() %>
<br />
diff --git a/libs/cbi/luasrc/view/cbi/simpleform.htm b/libs/cbi/luasrc/view/cbi/simpleform.htm
index a0bb0f02b..9c40f8290 100644
--- a/libs/cbi/luasrc/view/cbi/simpleform.htm
+++ b/libs/cbi/luasrc/view/cbi/simpleform.htm
@@ -20,8 +20,8 @@ $Id$
</div>
<% end %>
<div class="cbi-map" id="cbi-<%=self.config%>">
- <h2><a id="content" name="content"><%=self.title%></a></h2>
- <div class="cbi-map-descr"><%=self.description%></div>
+ <% if self.title and #self.title > 0 then %><h2><a id="content" name="content"><%=self.title%></a></h2><% end %>
+ <% if self.description and #self.description > 0 then %><div class="cbi-map-descr"><%=self.description%></div><% end %>
<% self:render_children() %>
<br />
</div>