Skip to content

Commit e6ac097

Browse files
committed
Fix symbols if showChildren true. Closes #85
1 parent c153ab8 commit e6ac097

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

jquery.slicknav.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,16 @@
149149
} else
150150
$(nodes).wrapAll('<span class="'+prefix+'_parent-link '+prefix+'_row"/>').parent();
151151

152-
item.addClass(prefix+'_collapsed');
152+
if (!settings.showChildren) {
153+
item.addClass(prefix+'_collapsed');
154+
} else {
155+
item.addClass(prefix+'_open');
156+
}
157+
153158
item.addClass(prefix+'_parent');
154159

155160
// create parent arrow. wrap with link if parent links and separating
156-
var arrowElement = $('<span class="'+prefix+'_arrow">'+settings.closedSymbol+'</span>');
161+
var arrowElement = $('<span class="'+prefix+'_arrow">'+(settings.showChildren?settings.openedSymbol:settings.closedSymbol)+'</span>');
157162

158163
if (settings.allowParentLinks && !settings.nestedParentLinks && containsAnchor)
159164
arrowElement = arrowElement.wrap(wrapElement).parent();

0 commit comments

Comments
 (0)