Fixed css-flashing
Signed-off-by: fnuesse <felix.nuesse@t-online.de> Fixed menu if initially empty Signed-off-by: fnuesse <felix.nuesse@t-online.de>
This commit is contained in:
parent
9cd4b53a51
commit
60e6ac3b6e
4 changed files with 33 additions and 7 deletions
|
@ -146,11 +146,17 @@
|
|||
var qaSelector= '#quickaccess-list';
|
||||
|
||||
if(itemId==='button-collapseQuickAccess'){
|
||||
|
||||
document.getElementById('enableQuickAccess').checked=!document.getElementById('enableQuickAccess').checked;
|
||||
$.get(OC.generateUrl("/apps/files/api/v1/showquickaccess"), {show: document.getElementById('enableQuickAccess').checked}, function(data, status){
|
||||
});
|
||||
$("#quickaccess-list" ).toggle('open');
|
||||
var dotmenu = document.getElementById("quickaccess-list");
|
||||
dotmenu.style.display='';
|
||||
|
||||
if(!$("#favorites-toggle" ).hasClass('open')){
|
||||
$("#favorites-toggle" ).addClass('open');
|
||||
}else{
|
||||
$("#favorites-toggle" ).removeClass('open');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(itemId==='button-favorites'){
|
||||
|
@ -173,7 +179,11 @@
|
|||
if(itemId==='enableQuickAccess' ){
|
||||
$.get(OC.generateUrl("/apps/files/api/v1/showquickaccess"), {show: document.getElementById('enableQuickAccess').checked}, function(data, status){
|
||||
});
|
||||
$(qaSelector).toggle('open');
|
||||
if(!$("#favorites-toggle" ).hasClass('open')){
|
||||
$("#favorites-toggle" ).addClass('open');
|
||||
}else{
|
||||
$("#favorites-toggle" ).removeClass('open');
|
||||
}
|
||||
document.getElementById('menu-favorites').classList.toggle('open');
|
||||
}
|
||||
|
||||
|
|
|
@ -83,6 +83,11 @@
|
|||
if(listUL.childElementCount==0){
|
||||
var dotmenu = document.getElementById("quickaccessbutton");
|
||||
dotmenu.style.display='none';
|
||||
|
||||
var collapsibleButton = document.getElementById("button-collapseQuickAccess");
|
||||
collapsibleButton.style.display='none';
|
||||
|
||||
$("#favorites-toggle" ).removeClass('collapsible');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -115,6 +120,11 @@
|
|||
listUL.appendChild(li);
|
||||
var dotmenu = document.getElementById("quickaccessbutton");
|
||||
dotmenu.style.display='';
|
||||
|
||||
var collapsibleButton = document.getElementById("button-collapseQuickAccess");
|
||||
collapsibleButton.style.display='';
|
||||
|
||||
$("#favorites-toggle" ).addClass('collapsible');
|
||||
}else{
|
||||
list[list.length-1].after(li);
|
||||
}
|
||||
|
|
|
@ -184,12 +184,17 @@ class ViewController extends Controller {
|
|||
|
||||
$FavoritesFolderCount=sizeof($favElements['folders']);
|
||||
|
||||
$collapsClasses='';
|
||||
if($FavoritesFolderCount>0){
|
||||
$collapsClasses='collapsible';
|
||||
}
|
||||
|
||||
\OCA\Files\App::getNavigationManager()->add(
|
||||
[
|
||||
'id' => 'favorites',
|
||||
'appname' => 'files',
|
||||
'script' => 'simplelist.php',
|
||||
'classes' => 'collapsible',
|
||||
'classes' => $collapsClasses,
|
||||
'enableQuickaccess' => $expanded,
|
||||
'quickaccessSortingStrategy' => $sorting,
|
||||
'quickaccessSortingReverse' => $reverseListSetting,
|
||||
|
|
|
@ -8,10 +8,11 @@
|
|||
|
||||
<li data-id="<?php p(isset($item['href']) ? $item['href'] : $item['id']) ?>"
|
||||
class="nav-<?php p($item['id']) ?> <?php p($item['classes']) ?> <?php p($pinned===1?'first-pinned':'') ?> <?php if($item['enableQuickaccess']=='true'){ ?> open<?php } ?>"
|
||||
<?php if(isset($item['folderPosition'])){ ?> folderPos="<?php p($item['folderPosition']);?>"<?php } ?>>
|
||||
<?php if(isset($item['folderPosition'])){ ?> folderPos="<?php p($item['folderPosition']);?>"<?php } ?>
|
||||
<?php if($item['id']=='favorites'){?>id="favorites-toggle"<?php } ?>>
|
||||
|
||||
<?php if($item['id']=='favorites'){?>
|
||||
<button id="button-collapseQuickAccess" class="collapse"></button><?php } ?>
|
||||
<button id="button-collapseQuickAccess" class="collapse" <?php if($item['favoritescount']==0){ ?> style="display: none"<?php } ?>></button><?php } ?>
|
||||
|
||||
<a href="<?php p(isset($item['href']) ? $item['href'] : '#') ?>"
|
||||
class="nav-icon-<?php p($item['icon'] !== '' ? $item['icon'] : $item['id']) ?> svg"><?php p($item['name']);?></a>
|
||||
|
|
Loading…
Reference in a new issue