[FIX] web_editor: open customize menus to the left/right
Open customize options menus to the left if there is not enough space on the right.
This commit is contained in:
@@ -298,8 +298,16 @@ var SnippetOption = Widget.extend({
|
||||
* @param {Event} ev
|
||||
*/
|
||||
_onLinkEnter: function (ev) {
|
||||
var $li = $(ev.currentTarget).parent(':hasData');
|
||||
if (!$li.length) {
|
||||
var $li = $(ev.currentTarget).parent();
|
||||
if ($li.is('.dropdown-submenu')) {
|
||||
var $menu = $li.children('.dropdown-menu');
|
||||
if ($menu.length) {
|
||||
var menuRightPosition = $li.offset().left + $li.outerWidth() + $menu.outerWidth();
|
||||
$menu.toggleClass('o_open_to_left', menuRightPosition > $(window).outerWidth());
|
||||
}
|
||||
}
|
||||
|
||||
if (!$li.is(':hasData')) {
|
||||
return;
|
||||
}
|
||||
this.__click = false;
|
||||
|
||||
@@ -452,6 +452,11 @@ html[lang] > body.editor_enable [data-oe-translation-state] {
|
||||
display: block;
|
||||
left: 100%;
|
||||
top: 0;
|
||||
|
||||
&.o_open_to_left {
|
||||
left: auto;
|
||||
right: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.dropdown-submenu:before {
|
||||
|
||||
Reference in New Issue
Block a user