add support for extra actions in 'sandwich' menu (#14830)

The menu should be a list with "extra-actions-menu" class and the
toggler a link with class "extra-actions-menu-opener".

For example:

<a class="extra-actions-menu-opener"></a>
<ul class="extra-actions-menu">
  ...
</ul>
This commit is contained in:
Serghei Mihai 2017-01-31 11:42:16 +01:00 committed by Frédéric Péters
parent 29f7e00f03
commit 7ebb003124
2 changed files with 59 additions and 0 deletions

View File

@ -865,6 +865,59 @@ ul.apps li.icon-announces a:hover { background-image: url(icons/announces.large-
}
}
#appbar {
.extra-actions-menu-opener {
border: none;
&::before {
cursor: pointer;
content: "\f142"; /* ellipsis-v */
font-family: FontAwesome;
font-size: 140%;
padding: 2px 1ex;
margin-right: -0.5ex;
border: 1px solid transparent;
border-bottom: 0;
position: relative;
z-index: 200;
top: 2px;
}
&.open::before {
background: #fafafa;
border-color: #d0d0d0;
}
}
.extra-actions-menu {
background: white;
padding: 0px;
list-style: none;
position: absolute;
right: -7px;
margin-top: -24px;
border: 1px solid #d0d0d0;
background: #fafafa;
box-shadow: 0px 1px 1px 2px rgba(0, 0, 0, 0.04);
z-index: 100;
display: none;
min-width: 12em;
&.open {
display: block;
}
li {
margin: 0;
a {
float: none;
display: block;
margin: 0;
padding: 5px 10px;
border: none;
&:hover {
background: #ccc;
}
}
}
}
}
@import 'grid';
@import 'jqueryui';
@import 'forms';

View File

@ -324,4 +324,10 @@ var gadjo_js = gadjo_js || {};
$(this).prepend(elem);
});
});
$(function() {
$('a.extra-actions-menu-opener').on('click', function() {
$(this).toggleClass('open');
$('.extra-actions-menu').toggleClass('open');
});
});
})();