From 4f8af5b4e7d5d9934b06f2f0feae1c86299849da Mon Sep 17 00:00:00 2001 From: Unick Soft Date: Sat, 29 Dec 2018 19:14:28 +0200 Subject: [PATCH] Fix algorithm menu. Offset it if need. --- lang/en/main_tpl.php | 2 +- script/main.js | 22 +++++++++++++++++++++- tpl/home.php | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/lang/en/main_tpl.php b/lang/en/main_tpl.php index 96a2f58..d8cc1b2 100755 --- a/lang/en/main_tpl.php +++ b/lang/en/main_tpl.php @@ -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"] = "Graph Online is online project aimed at creation and easy visualization of graph and shortest path searching. Also you can create graph from adjacency matrix. About project and look help page.\n"; + $g_lang["footer_info"] = "Graph Online is online project aimed at creation and easy visualization of graph and shortest path searching. Also you can create graph from adjacency matrixAbout project and look help page.\n"; $g_lang["lang"] = "Language"; ?> \ No newline at end of file diff --git a/script/main.js b/script/main.js index e7c7a2b..d7be04a 100644 --- a/script/main.js +++ b/script/main.js @@ -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 () diff --git a/tpl/home.php b/tpl/home.php index 6b6e04c..09f06e6 100755 --- a/tpl/home.php +++ b/tpl/home.php @@ -97,7 +97,7 @@
-