From 75a8fc81c1b49a9b2ad610e801f56b3f05d13d00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Smodi=C5=A1?= Date: Fri, 2 Oct 2015 12:22:01 +0200 Subject: Prepend instead of append new hints and bold the first shown hint. --- css/codeq/hint.css | 4 ++++ js/codeq/hint.js | 15 ++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/css/codeq/hint.css b/css/codeq/hint.css index 00614ca..676d1aa 100644 --- a/css/codeq/hint.css +++ b/css/codeq/hint.css @@ -17,3 +17,7 @@ div:not(.hint-static-group) > div.hint-static { margin-left: auto; margin-right: auto; } + +.hints > :first-child { + font-weight: bold; +} \ No newline at end of file diff --git a/js/codeq/hint.js b/js/codeq/hint.js index 331c822..643a3a4 100644 --- a/js/codeq/hint.js +++ b/js/codeq/hint.js @@ -220,14 +220,15 @@ } } else { - jqContainer.append(jq); + jqContainer.prepend(jq); } codeq.tr.translateDom(jq); - // scroll into view if overflowing - deltaHeight = jqHints.height() - jqHintsContainer.height(); - if (deltaHeight > 0) { - jqHintsContainer.scrollTop(deltaHeight); - } + //// scroll into view if overflowing + //deltaHeight = jqHints.height() - jqHintsContainer.height(); + //if (deltaHeight > 0) { + // jqHintsContainer.scrollTop(deltaHeight); + //} + jqHintsContainer.scrollTop(0); }, jqContainer, jqButton; @@ -235,7 +236,7 @@ // hint sequence jqContainer = $('
'); jqButton = $(''); - jqHints.append(jqContainer); + jqHints.prepend(jqContainer); jqContainer.append(jqButton); jqButton.on('click', function () { nextJqHint(); -- cgit v1.2.1