Merge pull request #8373 from nextcloud/right-header-stdrd
New standard for top right header
This commit is contained in:
commit
d1aa96fef9
|
@ -88,15 +88,6 @@ thead {
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
}
|
}
|
||||||
|
|
||||||
#directLink-container {
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
#directLink {
|
|
||||||
margin-left: 30px;
|
|
||||||
flex-basis: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* header buttons */
|
/* header buttons */
|
||||||
#details {
|
#details {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
|
|
|
@ -47,8 +47,12 @@ class LinkMenuAction extends SimpleMenuAction {
|
||||||
'<a id="directLink-container">' .
|
'<a id="directLink-container">' .
|
||||||
'<span class="icon ' . Util::sanitizeHTML($this->getIcon()) . '"></span>' .
|
'<span class="icon ' . Util::sanitizeHTML($this->getIcon()) . '"></span>' .
|
||||||
'<label for="directLink">' . Util::sanitizeHTML($this->getLabel()) . '</label>' .
|
'<label for="directLink">' . Util::sanitizeHTML($this->getLabel()) . '</label>' .
|
||||||
'<input id="directLink" type="text" readonly="" value="' . Util::sanitizeHTML($this->getLink()) . '">' .
|
|
||||||
'</a>' .
|
'</a>' .
|
||||||
|
'</li>' .
|
||||||
|
'<li>' .
|
||||||
|
'<span class="menuitem">' .
|
||||||
|
'<input id="directLink" type="text" readonly="" value="' . Util::sanitizeHTML($this->getLink()) . '">' .
|
||||||
|
'</span>' .
|
||||||
'</li>';
|
'</li>';
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -74,13 +74,17 @@
|
||||||
#header {
|
#header {
|
||||||
/* Header menu */
|
/* Header menu */
|
||||||
.menu {
|
.menu {
|
||||||
top: 45px;
|
|
||||||
background-color: $color-main-background;
|
background-color: $color-main-background;
|
||||||
filter: drop-shadow(0 1px 10px $color-box-shadow);
|
filter: drop-shadow(0 1px 10px $color-box-shadow);
|
||||||
border-radius: 0 0 3px 3px;
|
border-radius: 0 0 3px 3px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
z-index: 2000;
|
z-index: 2000;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
max-width: 350px;
|
||||||
|
max-height: 280px;
|
||||||
|
right: 0;
|
||||||
|
top: 44px;
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
&:not(.popovermenu) {
|
&:not(.popovermenu) {
|
||||||
display: none;
|
display: none;
|
||||||
|
@ -96,6 +100,7 @@
|
||||||
width: 0;
|
width: 0;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
right: 12px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.logo {
|
.logo {
|
||||||
|
@ -151,6 +156,25 @@
|
||||||
#header-right, .header-right {
|
#header-right, .header-right {
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Right header standard */
|
||||||
|
.header-right {
|
||||||
|
> div,
|
||||||
|
> form {
|
||||||
|
position: relative;
|
||||||
|
> .menutoggle {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 44px;
|
||||||
|
height: 44px;
|
||||||
|
cursor: pointer;
|
||||||
|
opacity: 0.6;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* hover effect for app switcher label */
|
/* hover effect for app switcher label */
|
||||||
|
@ -199,16 +223,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/* NAVIGATION --------------------------------------------------------------- */
|
/* NAVIGATION --------------------------------------------------------------- */
|
||||||
nav {
|
nav[role='navigation'] {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 44px;
|
width: 44px;
|
||||||
height: 44px;
|
height: 44px;
|
||||||
margin-left: -54px;
|
margin-left: -44px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-left #navigation {
|
.header-left #navigation {
|
||||||
position: relative;
|
position: relative;
|
||||||
left: -100%;
|
left: 22px; /* half the togglemenu */
|
||||||
|
transform: translateX(-50%);
|
||||||
width: 160px;
|
width: 160px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,7 +244,7 @@ nav {
|
||||||
filter: drop-shadow(0 1px 10px $color-box-shadow);
|
filter: drop-shadow(0 1px 10px $color-box-shadow);
|
||||||
&:after {
|
&:after {
|
||||||
/* position of dropdown arrow */
|
/* position of dropdown arrow */
|
||||||
left: 47%;
|
left: 50%;
|
||||||
bottom: 100%;
|
bottom: 100%;
|
||||||
border: solid transparent;
|
border: solid transparent;
|
||||||
content: ' ';
|
content: ' ';
|
||||||
|
@ -229,24 +254,9 @@ nav {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
border-color: rgba(0, 0, 0, 0);
|
border-color: rgba(0, 0, 0, 0);
|
||||||
border-bottom-color: $color-main-background;
|
border-bottom-color: $color-main-background;
|
||||||
border-width: 9px;
|
|
||||||
margin-left: -9px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* arrow look */
|
|
||||||
#expanddiv:after {
|
|
||||||
bottom: 100%;
|
|
||||||
border: solid transparent;
|
|
||||||
content: ' ';
|
|
||||||
height: 0;
|
|
||||||
width: 0;
|
|
||||||
position: absolute;
|
|
||||||
pointer-events: none;
|
|
||||||
border-color: transparent;
|
|
||||||
border-bottom-color: $color-main-background;
|
|
||||||
border-width: 10px;
|
border-width: 10px;
|
||||||
margin-left: -10px;
|
margin-left: -10px; /* border width */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#navigation {
|
#navigation {
|
||||||
|
@ -259,10 +269,10 @@ nav {
|
||||||
}
|
}
|
||||||
a {
|
a {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: block;
|
display: inline-flex;
|
||||||
padding: 10px 12px;
|
padding: 10px 12px;
|
||||||
height:40px;
|
height: 40px;
|
||||||
vertical-align: text-bottom;
|
align-items: center;
|
||||||
span {
|
span {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
|
@ -277,9 +287,6 @@ nav {
|
||||||
span {
|
span {
|
||||||
opacity: .7;
|
opacity: .7;
|
||||||
}
|
}
|
||||||
svg {
|
|
||||||
margin-bottom: 2px;
|
|
||||||
}
|
|
||||||
&:hover svg,
|
&:hover svg,
|
||||||
&:focus svg,
|
&:focus svg,
|
||||||
&:hover span,
|
&:hover span,
|
||||||
|
@ -299,11 +306,9 @@ nav {
|
||||||
max-width: 32px;
|
max-width: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
/* loading feedback for apps */
|
||||||
|
.app-loading {
|
||||||
/* loading feedback for apps */
|
.icon-loading-small {
|
||||||
.app-loading {
|
|
||||||
.icon-loading-small-dark {
|
|
||||||
display: inline !important;
|
display: inline !important;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 12px;
|
left: 12px;
|
||||||
|
@ -313,6 +318,8 @@ nav {
|
||||||
.app-icon {
|
.app-icon {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Apps management */
|
/* Apps management */
|
||||||
|
@ -335,25 +342,13 @@ nav {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
color: rgba($color-primary-text, 0.7);
|
color: rgba($color-primary-text, 0.7);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
.icon-loading-small-dark {
|
margin-right: 13px;
|
||||||
display: inline-block;
|
|
||||||
margin-bottom: -3px;
|
|
||||||
margin-right: 6px;
|
|
||||||
background-size: 16px 16px;
|
|
||||||
}
|
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
}
|
|
||||||
|
|
||||||
/* User menu on the right */
|
/* User menu on the right */
|
||||||
#expand {
|
#expand {
|
||||||
position: relative;
|
opacity: 1; /* override icon opacity */
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 7px 20px 6px 10px;
|
|
||||||
cursor: pointer;
|
|
||||||
* {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
img {
|
img {
|
||||||
opacity: .7;
|
opacity: .7;
|
||||||
margin-bottom: -2px;
|
margin-bottom: -2px;
|
||||||
|
@ -362,8 +357,8 @@ nav {
|
||||||
&:focus,
|
&:focus,
|
||||||
&:active {
|
&:active {
|
||||||
color: $color-primary-text;
|
color: $color-primary-text;
|
||||||
img,
|
|
||||||
#expandDisplayName {
|
img, #expandDisplayName {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -373,6 +368,7 @@ nav {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
width: 32px;
|
width: 32px;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
@ -386,16 +382,15 @@ nav {
|
||||||
#expandDisplayName {
|
#expandDisplayName {
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
opacity: .6;
|
opacity: .6;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* full opacity for gear icon if active */
|
/* full opacity for gear icon if active */
|
||||||
#body-settings #expandDisplayName {
|
#body-settings & {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* show triangle below user menu if active */
|
/* show triangle below user menu if active */
|
||||||
#body-settings #expand:before {
|
#body-settings &:before {
|
||||||
content: ' ';
|
content: ' ';
|
||||||
height: 0;
|
height: 0;
|
||||||
width: 0;
|
width: 0;
|
||||||
|
@ -404,30 +399,32 @@ nav {
|
||||||
border: 0 solid transparent;
|
border: 0 solid transparent;
|
||||||
border-bottom-color: $color-main-background;
|
border-bottom-color: $color-main-background;
|
||||||
border-width: 10px;
|
border-width: 10px;
|
||||||
transform: translateX(-50%);
|
|
||||||
left: 26px;
|
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
display: block;
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#expanddiv {
|
#expanddiv {
|
||||||
right: 13px;
|
|
||||||
background: $color-main-background;
|
|
||||||
&:after {
|
|
||||||
/* position of dropdown arrow */
|
|
||||||
right: 13px;
|
|
||||||
}
|
|
||||||
a {
|
a {
|
||||||
display: block;
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
color: $color-main-text;
|
color: $color-main-text;
|
||||||
padding: 10px 12px 0;
|
padding: 12px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
opacity: .7;
|
opacity: .7;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
|
.icon-loading-small {
|
||||||
|
margin-right: 9px;
|
||||||
|
background-size: 16px 16px;
|
||||||
|
}
|
||||||
img {
|
img {
|
||||||
margin-bottom: -3px;
|
margin-right: 9px;
|
||||||
margin-right: 6px;
|
height: 16px;
|
||||||
|
width: 16px;
|
||||||
}
|
}
|
||||||
&:hover,
|
&:hover,
|
||||||
&:focus,
|
&:focus,
|
||||||
|
@ -463,10 +460,15 @@ nav {
|
||||||
opacity: .6;
|
opacity: .6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.app-loading .icon-loading-small-dark {
|
.app-loading {
|
||||||
top: 12px;
|
> svg {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.icon-loading-small-dark {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
|
display: block !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -131,3 +131,36 @@ table.multiselect thead {
|
||||||
|
|
||||||
/* end of media query */
|
/* end of media query */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 480px) {
|
||||||
|
#header .header-right .menu {
|
||||||
|
max-width: calc(100vw - 26px);
|
||||||
|
position: fixed;
|
||||||
|
right: 13px;
|
||||||
|
top: 45px;
|
||||||
|
&::after {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Arrow directly child of menutoggle */
|
||||||
|
#header .header-right > div {
|
||||||
|
&.openedMenu{
|
||||||
|
&::after {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&::after {
|
||||||
|
border: 10px solid transparent;
|
||||||
|
border-bottom-color: $color-main-background;
|
||||||
|
bottom: 0;
|
||||||
|
content: ' ';
|
||||||
|
height: 0;
|
||||||
|
width: 0;
|
||||||
|
position: absolute;
|
||||||
|
pointer-events: none;
|
||||||
|
right: 13px;
|
||||||
|
z-index: 2001;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menutoggle {
|
#header-secondary-action {
|
||||||
padding-right: 10px;
|
margin-right: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -464,7 +464,7 @@
|
||||||
|
|
||||||
OC.registerMenu(this._$trigger, this.$el, function() {
|
OC.registerMenu(this._$trigger, this.$el, function() {
|
||||||
this._toggleVisibility(true);
|
this._toggleVisibility(true);
|
||||||
}.bind(this));
|
}.bind(this), true);
|
||||||
this.$el.on('beforeHide', function() {
|
this.$el.on('beforeHide', function() {
|
||||||
this._toggleVisibility(false);
|
this._toggleVisibility(false);
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
|
@ -678,9 +678,10 @@ var OCP = {},
|
||||||
* @param {jQuery} $toggle
|
* @param {jQuery} $toggle
|
||||||
* @param {jQuery} $menuEl
|
* @param {jQuery} $menuEl
|
||||||
* @param {function|undefined} toggle callback invoked everytime the menu is opened
|
* @param {function|undefined} toggle callback invoked everytime the menu is opened
|
||||||
|
* @param {boolean} headerMenu is this a top right header menu?
|
||||||
* @returns {undefined}
|
* @returns {undefined}
|
||||||
*/
|
*/
|
||||||
registerMenu: function($toggle, $menuEl, toggle) {
|
registerMenu: function($toggle, $menuEl, toggle, headerMenu) {
|
||||||
var self = this;
|
var self = this;
|
||||||
$menuEl.addClass('menu');
|
$menuEl.addClass('menu');
|
||||||
$toggle.on('click.menu', function(event) {
|
$toggle.on('click.menu', function(event) {
|
||||||
|
@ -696,6 +697,11 @@ var OCP = {},
|
||||||
// close it
|
// close it
|
||||||
self.hideMenus();
|
self.hideMenus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (headerMenu === true) {
|
||||||
|
$menuEl.parent().addClass('openedMenu');
|
||||||
|
}
|
||||||
|
|
||||||
$menuEl.slideToggle(OC.menuSpeed, toggle);
|
$menuEl.slideToggle(OC.menuSpeed, toggle);
|
||||||
OC._currentMenu = $menuEl;
|
OC._currentMenu = $menuEl;
|
||||||
OC._currentMenuToggle = $toggle;
|
OC._currentMenuToggle = $toggle;
|
||||||
|
@ -730,6 +736,7 @@ var OCP = {},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
$('.openedMenu').removeClass('openedMenu');
|
||||||
OC._currentMenu = null;
|
OC._currentMenu = null;
|
||||||
OC._currentMenuToggle = null;
|
OC._currentMenuToggle = null;
|
||||||
},
|
},
|
||||||
|
@ -1396,7 +1403,7 @@ function initCore() {
|
||||||
initSessionHeartBeat();
|
initSessionHeartBeat();
|
||||||
}
|
}
|
||||||
|
|
||||||
OC.registerMenu($('#expand'), $('#expanddiv'));
|
OC.registerMenu($('#expand'), $('#expanddiv'), false, true);
|
||||||
|
|
||||||
// toggle for menus
|
// toggle for menus
|
||||||
$(document).on('mouseup.closemenus', function(event) {
|
$(document).on('mouseup.closemenus', function(event) {
|
||||||
|
@ -1480,7 +1487,7 @@ function initCore() {
|
||||||
if(event.which === 1 && !event.ctrlKey && !event.metaKey) {
|
if(event.which === 1 && !event.ctrlKey && !event.metaKey) {
|
||||||
$page.find('img').remove();
|
$page.find('img').remove();
|
||||||
$page.find('div').remove(); // prevent odd double-clicks
|
$page.find('div').remove(); // prevent odd double-clicks
|
||||||
$page.prepend($('<div/>').addClass('icon-loading-small-dark'));
|
$page.prepend($('<div/>').addClass('icon-loading-small'));
|
||||||
} else {
|
} else {
|
||||||
// Close navigation when opening menu entry in
|
// Close navigation when opening menu entry in
|
||||||
// a new tab
|
// a new tab
|
||||||
|
|
|
@ -54,6 +54,7 @@
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
<?php if($template->getActionCount()>1) { ?>
|
<?php if($template->getActionCount()>1) { ?>
|
||||||
|
<div id="header-secondary-action">
|
||||||
<span id="header-actions-toggle" class="menutoggle icon-more-white"></span>
|
<span id="header-actions-toggle" class="menutoggle icon-more-white"></span>
|
||||||
<div id="share-menu" class="popovermenu menu">
|
<div id="share-menu" class="popovermenu menu">
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -65,6 +66,7 @@
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
|
@ -80,7 +80,7 @@
|
||||||
<defs><filter id="invertMenuMore-<?php p($entry['id']); ?>"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"></feColorMatrix></filter></defs>
|
<defs><filter id="invertMenuMore-<?php p($entry['id']); ?>"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"></feColorMatrix></filter></defs>
|
||||||
<image x="0" y="0" width="16" height="16" preserveAspectRatio="xMinYMin meet" filter="url(#invertMenuMore-<?php p($entry['id']); ?>)" xlink:href="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>" class="app-icon"></image>
|
<image x="0" y="0" width="16" height="16" preserveAspectRatio="xMinYMin meet" filter="url(#invertMenuMore-<?php p($entry['id']); ?>)" xlink:href="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>" class="app-icon"></image>
|
||||||
</svg>
|
</svg>
|
||||||
<div class="icon-loading-small-dark" style="display:none;"></div>
|
<div class="icon-loading-small" style="display:none;"></div>
|
||||||
<span><?php p($entry['name']); ?></span>
|
<span><?php p($entry['name']); ?></span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Reference in New Issue