mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 12:33:27 +02:00
handle sidebar badging for new root values
This commit is contained in:
parent
542ce944ef
commit
f0aeaa1af8
2 changed files with 24 additions and 6 deletions
|
@ -391,9 +391,20 @@ function badgeSidebarForDifferences(changedElement) {
|
|||
// figure out which group this input is in
|
||||
var panelParentID = changedElement.closest('.panel').attr('id')
|
||||
|
||||
// get a JSON representation of that section
|
||||
var panelJSON = form2js(panelParentID, ".", false, cleanupFormValues, true)[panelParentID]
|
||||
var initialPanelJSON = Settings.initialValues[panelParentID]
|
||||
// if the panel contains non-grouped settings, the initial value is Settings.initialValues
|
||||
var isGrouped = $(panelParentID).hasClass('grouped');
|
||||
|
||||
if (isGrouped) {
|
||||
var initialPanelJSON = Settings.initialValues[panelParentID];
|
||||
|
||||
// get a JSON representation of that section
|
||||
var panelJSON = form2js(panelParentID, ".", false, cleanupFormValues, true)[panelParentID];
|
||||
} else {
|
||||
var initialPanelJSON = Settings.initialValues;
|
||||
|
||||
// get a JSON representation of that section
|
||||
var panelJSON = form2js(panelParentID, ".", false, cleanupFormValues, true);
|
||||
}
|
||||
|
||||
var badgeValue = 0
|
||||
|
||||
|
|
|
@ -10,8 +10,9 @@
|
|||
<div id="setup-sidebar" data-clampedwidth="#setup-sidebar-col" class="hidden-xs" data-spy="affix" data-offset-top="55">
|
||||
<script id="list-group-template" type="text/template">
|
||||
<% _.each(descriptions, function(group){ %>
|
||||
<% panelID = group.name ? group.name : group.label %>
|
||||
<li>
|
||||
<a href="#<%-group.name %>" class="list-group-item">
|
||||
<a href="#<%- panelID %>" class="list-group-item">
|
||||
<span class="badge"></span>
|
||||
<%- group.label %>
|
||||
</a>
|
||||
|
@ -37,7 +38,12 @@
|
|||
<% if (isAdvanced) { %>
|
||||
<% $("a[href=#" + group.name + "]").addClass('advanced-setting').hide() %>
|
||||
<% } %>
|
||||
<div class="panel panel-default <%- (isAdvanced) ? 'advanced-setting' : '' %>" id="<%- group.name %>">
|
||||
|
||||
<% isGrouped = !!group.name %>
|
||||
<% panelID = isGrouped ? group.name : group.label %>
|
||||
|
||||
<div class="panel panel-default<%- (isAdvanced) ? ' advanced-setting' : '' %><%- (isGrouped) ? ' grouped' : '' %>"
|
||||
id="<%- panelID %>">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><%- group.label %></h3>
|
||||
</div>
|
||||
|
@ -55,6 +61,7 @@
|
|||
<% }%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% }); %>
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in a new issue