Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging

pull/1/head
yflory 5 years ago
commit f966a479de

@ -184,7 +184,7 @@ define([], function () {
box-sizing: border-box; box-sizing: border-box;
width: 80px; width: 80px;
height: 80px; height: 80px;
border: 11px solid lightgrey; border: 11px solid white;
border-radius: 50%; border-radius: 50%;
border-top-color: transparent; border-top-color: transparent;
animation: spin infinite 3s; animation: spin infinite 3s;

@ -29,10 +29,6 @@
.dropdown-menu { .dropdown-menu {
top: -0.7rem; top: -0.7rem;
left: 100%; left: 100%;
&.left {
left: 0%;
transform: translate(-100%);
}
} }
} }
a { a {

@ -498,10 +498,16 @@ define([
var $el = $(el); var $el = $(el);
var $a = $el.children().filter("a"); var $a = $el.children().filter("a");
var $sub = $el.find(".dropdown-menu").first(); var $sub = $el.find(".dropdown-menu").first();
var left, bottomOffset;
var timeoutId; var timeoutId;
var showSubmenu = function () { var showSubmenu = function () {
clearTimeout(timeoutId); clearTimeout(timeoutId);
$sub.toggleClass("left", $el.offset().left + $el.outerWidth() + $sub.outerWidth() > $(window).width()); left = $el.offset().left + $el.outerWidth() + $sub.outerWidth() > $(window).width();
bottomOffset = $el.offset().top + $el.outerHeight() + $sub.outerHeight() - $(window).height();
$sub.css("left", left ? "0%": "100%");
$sub.css("transform", "translate("
+ (left ? "-100%" : "0")
+ "," + (bottomOffset > 0 ? -(bottomOffset - $el.outerHeight()) : 0) + "px)");
$el.siblings().find(".dropdown-menu").hide(); $el.siblings().find(".dropdown-menu").hide();
$sub.show(); $sub.show();
}; };

Loading…
Cancel
Save