fix #19: add option to keep external sites in the top menu
This commit is contained in:
@@ -8,6 +8,16 @@
|
||||
<?php endforeach; ?>
|
||||
}
|
||||
|
||||
<?php if ($_['external-sites-in-top-menu'] === false): ?>
|
||||
#appmenu {
|
||||
display: none;
|
||||
}
|
||||
<?php endif; ?>
|
||||
|
||||
#appmenu + nav {
|
||||
display: none;
|
||||
}
|
||||
|
||||
<?php if ($_['opener-only'] === true): ?>
|
||||
#nextcloud {
|
||||
display: none;
|
||||
|
||||
@@ -9,6 +9,30 @@
|
||||
sideMenuContainer.attr('data-forcelighticon', '1')
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($_['external-sites-in-top-menu']): ?>
|
||||
sideMenuContainer.attr('data-externalsitesintopmenu', '1')
|
||||
|
||||
var externalSitesInTopMenu = function() {
|
||||
var items = $('#appmenu').find('li')
|
||||
|
||||
items.each(function(i, item) {
|
||||
var dataId = item.getAttribute('data-id')
|
||||
|
||||
if (dataId === null || dataId.indexOf('external_index') === -1) {
|
||||
item.style.display = 'none'
|
||||
item.classList.remove('hidden')
|
||||
} else {
|
||||
item.style.display = 'flex'
|
||||
item.classList.add('hidden')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
$(window).resize(externalSitesInTopMenu);
|
||||
|
||||
setInterval(externalSitesInTopMenu, 500);
|
||||
<?php endif; ?>
|
||||
|
||||
body.on('side-menu.apps', function(e, apps) {
|
||||
<?php if ($_['hide-when-no-apps']): ?>
|
||||
sideMenu = $('#side-menu')
|
||||
|
||||
@@ -248,6 +248,23 @@ $choicesSizes = [
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="side-menu-external-sites-in-top-menu" class="settings-hint">
|
||||
<?php p($l->t('Do not move external sites in the side menu')); ?>
|
||||
<small><span class="warning">Experimental</span></small>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<select id="side-menu-external-sites-in-top-menu" name="external-sites-in-top-menu">
|
||||
<?php foreach ($choicesYesNo as $label => $value): ?>
|
||||
<option value="<?php echo $value ?>" <?php if ($value === $_['external-sites-in-top-menu']): ?>selected<?php endif; ?>>
|
||||
<?php echo $l->t($label); ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
|
||||
Reference in New Issue
Block a user