Fix algorithm menu. Offset it if need.

This commit is contained in:
Unick Soft
2018-12-29 19:14:28 +02:00
parent d114ab6fa9
commit 4f8af5b4e7
3 changed files with 23 additions and 3 deletions

View File

@@ -10,7 +10,7 @@
$g_lang["menu_7"] = "Quick Start";
$g_lang["menu_8"] = "News";
$g_lang["menu_9"] = "Using graph example";
$g_lang["footer_info"] = "<a href=\"/en/\">Graph Online</a>&nbsp;is online project aimed at&nbsp;creation and easy visualization of graph and <a href=\"/en/\">shortest path searching</a>. Also you can create&nbsp;<a href=\"http://graph.unick-soft.ru/en/create_graph_by_matrix\">graph from adjacency matrix</a>.&nbsp;A<a href=\"/en/about\">bout project</a> and <a href=\"http://graph.unick-soft.ru/en/help\">look help page</a>.\n";
$g_lang["footer_info"] = "<a href=\"/en/\">Graph Online</a>&nbsp;is online project aimed at&nbsp;creation and easy visualization of graph and <a href=\"/en/\">shortest path searching</a>. Also you can create&nbsp;<a href=\"http://graph.unick-soft.ru/en/create_graph_by_matrix\">graph from adjacency matrix</a>.&nbsp;<a href=\"/en/about\">About project</a> and <a href=\"http://graph.unick-soft.ru/en/help\">look help page</a>.\n";
$g_lang["lang"] = "Language";
?>

View File

@@ -484,7 +484,27 @@ function postLoadPage()
}
}
document.getElementById('openAlgorithmList').onclick = function()
{
// Show menu first
setTimeout(function()
{
var button = document.getElementById('openAlgorithmList');
var buttonRect = button.getBoundingClientRect();
var algorithmList = document.getElementById('algorithmList');
var delta = buttonRect.right - algorithmList.offsetWidth;
if (delta < 0)
{
var value = (delta - 4) + "px";
algorithmList.style.right = value;
}
else
{
algorithmList.style.right = "0";
}
}, 1);
}
if (document.getElementById('VoteButton') !== null)
document.getElementById('VoteButton').onclick = function ()

View File

@@ -97,7 +97,7 @@
<!-- Algorithms -->
<div class="btn-group" role="group">
<button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" aria-expanded="false" id="openAlgorithmList">
<span class="glyphicon glyphicon-cog fa-fw "></span><span class="hidden-phone"> <?= L('algorithms') ?> </span><span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu" id="algorithmList">