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';
|
var qaSelector= '#quickaccess-list';
|
||||||
|
|
||||||
if(itemId==='button-collapseQuickAccess'){
|
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){
|
$.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");
|
if(!$("#favorites-toggle" ).hasClass('open')){
|
||||||
dotmenu.style.display='';
|
$("#favorites-toggle" ).addClass('open');
|
||||||
|
}else{
|
||||||
|
$("#favorites-toggle" ).removeClass('open');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(itemId==='button-favorites'){
|
if(itemId==='button-favorites'){
|
||||||
|
@ -173,7 +179,11 @@
|
||||||
if(itemId==='enableQuickAccess' ){
|
if(itemId==='enableQuickAccess' ){
|
||||||
$.get(OC.generateUrl("/apps/files/api/v1/showquickaccess"), {show: document.getElementById('enableQuickAccess').checked}, function(data, status){
|
$.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');
|
document.getElementById('menu-favorites').classList.toggle('open');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,11 @@
|
||||||
if(listUL.childElementCount==0){
|
if(listUL.childElementCount==0){
|
||||||
var dotmenu = document.getElementById("quickaccessbutton");
|
var dotmenu = document.getElementById("quickaccessbutton");
|
||||||
dotmenu.style.display='none';
|
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);
|
listUL.appendChild(li);
|
||||||
var dotmenu = document.getElementById("quickaccessbutton");
|
var dotmenu = document.getElementById("quickaccessbutton");
|
||||||
dotmenu.style.display='';
|
dotmenu.style.display='';
|
||||||
|
|
||||||
|
var collapsibleButton = document.getElementById("button-collapseQuickAccess");
|
||||||
|
collapsibleButton.style.display='';
|
||||||
|
|
||||||
|
$("#favorites-toggle" ).addClass('collapsible');
|
||||||
}else{
|
}else{
|
||||||
list[list.length-1].after(li);
|
list[list.length-1].after(li);
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,12 +184,17 @@ class ViewController extends Controller {
|
||||||
|
|
||||||
$FavoritesFolderCount=sizeof($favElements['folders']);
|
$FavoritesFolderCount=sizeof($favElements['folders']);
|
||||||
|
|
||||||
|
$collapsClasses='';
|
||||||
|
if($FavoritesFolderCount>0){
|
||||||
|
$collapsClasses='collapsible';
|
||||||
|
}
|
||||||
|
|
||||||
\OCA\Files\App::getNavigationManager()->add(
|
\OCA\Files\App::getNavigationManager()->add(
|
||||||
[
|
[
|
||||||
'id' => 'favorites',
|
'id' => 'favorites',
|
||||||
'appname' => 'files',
|
'appname' => 'files',
|
||||||
'script' => 'simplelist.php',
|
'script' => 'simplelist.php',
|
||||||
'classes' => 'collapsible',
|
'classes' => $collapsClasses,
|
||||||
'enableQuickaccess' => $expanded,
|
'enableQuickaccess' => $expanded,
|
||||||
'quickaccessSortingStrategy' => $sorting,
|
'quickaccessSortingStrategy' => $sorting,
|
||||||
'quickaccessSortingReverse' => $reverseListSetting,
|
'quickaccessSortingReverse' => $reverseListSetting,
|
||||||
|
|
|
@ -8,10 +8,11 @@
|
||||||
|
|
||||||
<li data-id="<?php p(isset($item['href']) ? $item['href'] : $item['id']) ?>"
|
<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 } ?>"
|
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'){?>
|
<?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'] : '#') ?>"
|
<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>
|
class="nav-icon-<?php p($item['icon'] !== '' ? $item['icon'] : $item['id']) ?> svg"><?php p($item['name']);?></a>
|
||||||
|
|
Loading…
Reference in a new issue