Changeset 6372

Show
Ignore:
Timestamp:
10/31/10 20:34:45 (3 years ago)
Author:
jow
Message:

libs/web: add support for post commit redirects in cbi maps

Location:
luci/trunk/libs/web/luasrc/view/cbi
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/libs/web/luasrc/view/cbi/apply_xhr.htm

    r6306 r6372  
    1313-%> 
    1414 
    15 <% export("cbi_apply_xhr", function(id, configs) -%> 
     15<% export("cbi_apply_xhr", function(id, configs, redirect) -%> 
    1616<fieldset class="cbi-section" id="cbi-apply-<%=id%>"> 
    1717    <legend><%:Applying changes%></legend> 
     
    3434                                    { 
    3535                                        e.innerHTML = '<%:Configuration applied.%>'; 
    36                                         window.setTimeout(function() { e.parentNode.style.display = 'none' }, 1000); 
     36                                        window.setTimeout(function() { 
     37                                            e.parentNode.style.display = 'none'; 
     38                                            <% if redirect then %>location.href='<%=redirect%>';<% end %> 
     39                                        }, 1000); 
    3740                                    } 
    3841                                } 
  • luci/trunk/libs/web/luasrc/view/cbi/map.htm

    r6306 r6372  
    1919    <% if self.title and #self.title > 0 then %><h2><a id="content" name="content"><%=self.title%></a></h2><% end %> 
    2020    <% if self.description and #self.description > 0 then %><div class="cbi-map-descr"><%=self.description%></div><% end %> 
    21     <%- if self._apply then cbi_apply_xhr(self.config, self.parsechain) end -%> 
     21    <%- if self._apply then cbi_apply_xhr(self.config, self.parsechain, self.redirect) end -%> 
    2222    <%- self:render_children() %> 
    2323    <br />