mirror of
https://github.com/corda/corda.git
synced 2025-04-07 11:27:01 +00:00
CORDA-1710 Swap order of Java and Kotlin examples in HTML docs (#3488)
* Swap order of Java and Kotlin examples in HTML docs * Nicer comment * Put the hiding of kotlin examples back in the css file (so they start out hidden rather than being hidden when the JS runs - this could potentially make a difference with a large page over a slow connection)
This commit is contained in:
parent
20b89e06fa
commit
a5f43110f0
@ -1,8 +1,8 @@
|
||||
$(document).ready(function() {
|
||||
$(".codeset").each(function(index, el) {
|
||||
var c = $("<div class='codesnippet-widgets'><span class='current'>Kotlin</span><span>Java</span></div>");
|
||||
var kotlinButton = c.children()[0];
|
||||
var javaButton = c.children()[1];
|
||||
var c = $("<div class='codesnippet-widgets'><span class='current'>Java</span><span>Kotlin</span></div>");
|
||||
var javaButton = c.children()[0];
|
||||
var kotlinButton = c.children()[1];
|
||||
kotlinButton.onclick = function() {
|
||||
$(el).children(".highlight-java")[0].style.display = "none";
|
||||
$(el).children(".highlight-kotlin")[0].style.display = "block";
|
||||
@ -19,6 +19,8 @@ $(document).ready(function() {
|
||||
if ($(el).children(".highlight-java").length == 0) {
|
||||
// No Java for this example.
|
||||
javaButton.style.display = "none";
|
||||
// In this case, display Kotlin by default
|
||||
$(el).children(".highlight-kotlin")[0].style.display = "block";
|
||||
}
|
||||
c.insertBefore(el);
|
||||
});
|
||||
|
@ -122,7 +122,7 @@ a:visited {
|
||||
background: #263673;
|
||||
}
|
||||
|
||||
.codeset > .highlight-java {
|
||||
.codeset > .highlight-kotlin {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user