From 89e07dbf9af626a7f587e43b37bf3994ecd492b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Tue, 20 Jun 2017 20:37:10 +0200 Subject: [PATCH] fix alignment of sublevel control on mobile --- src/c3nav/editor/static/editor/js/editor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/c3nav/editor/static/editor/js/editor.js b/src/c3nav/editor/static/editor/js/editor.js index 4aa71d38..2dcaf7b3 100644 --- a/src/c3nav/editor/static/editor/js/editor.js +++ b/src/c3nav/editor/static/editor/js/editor.js @@ -181,11 +181,12 @@ editor = { editor._fill_level_control(editor._level_control, content.find('[data-levels]')); editor._fill_level_control(editor._sublevel_control, content.find('[data-sublevels]')); + var level_control_offset = $(editor._level_control_container).position(); var level_control_offset = $(editor._level_control_container).position(); var offset_parent = $(editor._level_control_container).offsetParent(); $(editor._sublevel_control._container).css({ - bottom: offset_parent.height()-level_control_offset.top-editor._level_control_container.height()-parseInt(editor._level_control_container.css('margin-bottom')), - right: offset_parent.width()-level_control_offset.left + bottom: offset_parent.outerHeight()-level_control_offset.top-editor._level_control_container.outerHeight()-parseInt(editor._level_control_container.css('margin-bottom')), + right: offset_parent.outerWidth()-level_control_offset.left }); } else { $body.removeClass('show-map');