Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ys2843 committed Apr 29, 2020
1 parent c1646ed commit 5d76f83
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h2>Installing MXNet</h2>
<span>MXNet Version</span>
</div>
<div class="col-9 install-right">
<div class="dropdown">
<div class="dropdown" id="version-dropdown-container">
<button class="current-version dropbtn btn" type="button" data-toggle="dropdown">
v1.6.0
<svg class="dropdown-caret" viewBox="0 0 32 32" class="icon icon-caret-bottom" aria-hidden="true">
Expand Down
22 changes: 12 additions & 10 deletions docs/static_site/src/assets/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,19 @@ $(document).ready(function () {
});

let timer;
const mouseenterHandler = function() {
const toggleDropdown = function(showContent) {
if (timer) clearTimeout(timer);
timer = setTimeout(function() {
$(".version-dropdown").show()
}, 250);
}

const mouseleaveHandler = function() {
if (timer) clearTimeout(timer);
$(".version-dropdown").hide()
if (showContent) {
timer = setTimeout(function() {
$(".version-dropdown").show()
}, 250);
} else {
$(".version-dropdown").hide()
}
}

$(".dropdown").mouseenter(mouseenterHandler).mouseleave(mouseleaveHandler);
$("#version-dropdown-container")
.mouseenter(toggleDropdown.bind(null, true))
.mouseleave(toggleDropdown.bind(null, false))
.click(toggleDropdown.bind(null, false));
});

0 comments on commit 5d76f83

Please sign in to comment.