Fixes bugs with 'collapsed' saved to cookies (#4080)

Credit to @w20k. Fixes #4047
This commit is contained in:
Denis Denisov 2019-01-23 09:30:53 +02:00 committed by Luke Towers
parent d5eca59dc6
commit 880d614bc5
3 changed files with 5 additions and 5 deletions

View File

@ -1102,8 +1102,8 @@ self.saveGroupStatus($(group).data('group-code'),true)}})}
SidenavTree.prototype.expandGroup=function(group,duration){var
$list=$('> ul',group),self=this
duration=duration===undefined?100:duration
$list.css({'overflow':'hidden','display':'','height':0})
$list.animate({'height':$list[0].scrollHeight},{duration:duration,queue:false,complete:function(){$list.css({'overflow':'visible','height':'auto'})
$list.css({'overflow':'hidden','height':0})
$list.animate({'height':$list[0].scrollHeight},{duration:duration,queue:false,complete:function(){$list.css({'overflow':'visible','height':'auto','display':''})
$(group).attr('data-status','expanded')
$(window).trigger('oc.updateUi')
self.saveGroupStatus($(group).data('group-code'),false)}})}

View File

@ -100,13 +100,13 @@
$list.css({
'overflow': 'hidden',
'display': '',
'height': 0
})
$list.animate({'height': $list[0].scrollHeight}, { duration: duration, queue: false, complete: function() {
$list.css({
'overflow': 'visible',
'height': 'auto'
'height': 'auto',
'display': ''
})
$(group).attr('data-status', 'expanded')
$(window).trigger('oc.updateUi')

View File

@ -15,7 +15,7 @@
<h3><?= e(trans($category)) ?></h3>
</div>
<ul>
<ul <?= $collapsed ? 'style="overflow: visible; height: 0px; display: none;"' : null ?>>
<?php foreach ($items as $item): ?>
<li class="<?= strtolower($item->owner) == $context->owner && strtolower($item->code) == $context->itemCode ? 'active' : false ?>" data-keywords="<?= e(trans($item->keywords)) ?>">
<a href="<?= $item->url ?>" ontouchstart="">