summaryrefslogtreecommitdiff
path: root/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2015-12-24 18:32:29 +0100
committerFelix Mulder <felix.mulder@gmail.com>2016-01-04 18:18:04 +0100
commit30959e5b6b9267286d10c0a7ef2f7cc17f43fcbd (patch)
treeb5b28b7b84fb8abbf5c93af947410715b026202a /src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js
parent73d8306424931acb301c9c00b19d72d31f51037e (diff)
downloadscala-30959e5b6b9267286d10c0a7ef2f7cc17f43fcbd.tar.gz
scala-30959e5b6b9267286d10c0a7ef2f7cc17f43fcbd.tar.bz2
scala-30959e5b6b9267286d10c0a7ef2f7cc17f43fcbd.zip
add mobile CSS rules for updated scaladoc look
This commit addresses the need for an improved mobile viewing experience. Specifically it introduces CSS media queries to adjust sizing and indentation of elements on mobile devices. This includes the following changes: - replace absolute font sizing with relative font sizing - fix font-resizing issues for mobile by fixing viewport - hide related links when viewport too small - fix missing trigram from heaven on Android - remove indentation on annotations e.g. `@throws` and place associated text on a separate line - fix bottom scoll-bar appearing on code-snippets - add spacing between entity icons in browser - add dynamic top offset for entity description - fix long entity names corrupting style - remove "EXPERIMENTAL" button from shortcomment divs on mobile
Diffstat (limited to 'src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js')
-rw-r--r--src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js b/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js
index 9eaabc4cf0..cad4072912 100644
--- a/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js
+++ b/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js
@@ -14,6 +14,17 @@ var title = $(document).attr('title');
var lastFragment = "";
$(document).ready(function() {
+ /* check if browser is mobile, if so hide class nav */
+ if( /Android|webOS|Mobi|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
+ $("#browser").toggleClass("full-screen");
+ $("#content").toggleClass("full-screen");
+ $("#letters").toggle();
+ setTimeout(function() {
+ $(".packages").hide();
+ $("#kindfilter").hide();
+ }, 4000);
+ }
+
$('iframe').bind("load", function(){
try {
var subtitle = $(this).contents().find('title').text();
@@ -354,9 +365,8 @@ function keyboardScrolldownLeftPane() {
/* Configures the text filter */
function configureTextFilter() {
scheduler.add("init", function() {
- $("#filter").prepend("<span class='toggle-sidebar'>☰</span>");
+ $("#filter").prepend("<span class='toggle-sidebar'></span>");
$("#textfilter").append("<span class='input'><input placeholder='Filter' id='index-input' type='text' accesskey='/'/></span><span class='clear'>✖</span>");
- $("#content").append("<span class='toggle-sidebar'>☰</span>");
var input = $("#textfilter input");
resizeFilterBlock();
input.bind('keyup', function(event) {