diff options
author | Scott Main <smain@google.com> | 2013-01-14 19:03:40 -0800 |
---|---|---|
committer | Scott Main <smain@google.com> | 2013-01-14 20:47:40 -0800 |
commit | eb41035fcfe1c223a794a24ee2fe8a8b133e67b1 (patch) | |
tree | a438d78afc8b67b6b47b5288c282def199b6f9d5 /tools/droiddoc/templates-sdk | |
parent | 869f3d1f68194b5962070394882b85f46a415c4c (diff) | |
download | build-eb41035fcfe1c223a794a24ee2fe8a8b133e67b1.zip build-eb41035fcfe1c223a794a24ee2fe8a8b133e67b1.tar.gz build-eb41035fcfe1c223a794a24ee2fe8a8b133e67b1.tar.bz2 |
docs: add the ability to pause the carousel
Change-Id: I1ffc929cf93217b578397d825e1eb41369d2666c
Diffstat (limited to 'tools/droiddoc/templates-sdk')
-rw-r--r-- | tools/droiddoc/templates-sdk/assets/css/default.css | 3 | ||||
-rw-r--r-- | tools/droiddoc/templates-sdk/assets/js/docs.js | 19 | ||||
-rw-r--r-- | tools/droiddoc/templates-sdk/trailer.cs | 3 |
3 files changed, 24 insertions, 1 deletions
diff --git a/tools/droiddoc/templates-sdk/assets/css/default.css b/tools/droiddoc/templates-sdk/assets/css/default.css index cd25dc5..247a6d3 100644 --- a/tools/droiddoc/templates-sdk/assets/css/default.css +++ b/tools/droiddoc/templates-sdk/assets/css/default.css @@ -1138,6 +1138,9 @@ td { background-color:inherit; border:solid 1px #DDD; } +td *:last-child { + margin-bottom:0; +} th { background-color: #999; color: #fff; diff --git a/tools/droiddoc/templates-sdk/assets/js/docs.js b/tools/droiddoc/templates-sdk/assets/js/docs.js index d603269..43bcb8f 100644 --- a/tools/droiddoc/templates-sdk/assets/js/docs.js +++ b/tools/droiddoc/templates-sdk/assets/js/docs.js @@ -1144,6 +1144,7 @@ function hideExpandable(ids) { * Options: * btnPrev: optional identifier for previous button * btnNext: optional identifier for next button + * btnPause: optional identifier for pause button * auto: whether or not to auto-proceed * speed: animation speed * autoTime: time between auto-rotation @@ -1161,6 +1162,7 @@ function hideExpandable(ids) { o = $.extend({ btnPrev: null, btnNext: null, + btnPause: null, auto: true, speed: 500, autoTime: 12000, @@ -1231,6 +1233,17 @@ function hideExpandable(ids) { e.preventDefault(); return go(curr+o.scroll); }); + + //Pause button + if(o.btnPause) + $(o.btnPause).click(function(e) { + e.preventDefault(); + if ($(this).hasClass('paused')) { + startRotateTimer(); + } else { + pauseRotateTimer(); + } + }); //Auto rotation if(o.auto) startRotateTimer(); @@ -1244,6 +1257,12 @@ function hideExpandable(ids) { go(curr+o.scroll); } }, o.autoTime); + $(o.btnPause).removeClass('paused'); + } + + function pauseRotateTimer() { + clearInterval(timer); + $(o.btnPause).addClass('paused'); } //Go to an item diff --git a/tools/droiddoc/templates-sdk/trailer.cs b/tools/droiddoc/templates-sdk/trailer.cs index f0b8a2f..1cf8793 100644 --- a/tools/droiddoc/templates-sdk/trailer.cs +++ b/tools/droiddoc/templates-sdk/trailer.cs @@ -29,7 +29,8 @@ window.gOverride = { <script type="text/javascript"> $('.slideshow-container').dacSlideshow({ btnPrev: '.slideshow-prev', - btnNext: '.slideshow-next' + btnNext: '.slideshow-next', + btnPause: '#pauseButton' }); </script> <?cs /if ?> |