Toggle close button on mouseleave

- Close #975
This commit is contained in:
Michael Rose 2017-04-27 15:55:49 -04:00
parent 8494157e64
commit 128977691a
6 changed files with 23 additions and 5 deletions

View file

@ -1,3 +1,9 @@
## Unreleased
### Bug Fixes
- Toggle close button on `mouseleave`. [#975](https://github.com/mmistakes/minimal-mistakes/issues/975)
## [4.4.1](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.4.1)
### Enhancements

File diff suppressed because one or more lines are too long

View file

@ -46,7 +46,9 @@ $(document).ready(function(){
$btn.attr("count", numOfItems - numOfVisibleItems);
if (numOfVisibleItems === numOfItems) {
$btn.addClass('hidden');
} else $btn.removeClass('hidden');
} else {
$btn.removeClass('hidden');
}
}
// Window listeners
@ -64,6 +66,7 @@ $(document).ready(function(){
// Mouse has left, start the timer
timer = setTimeout(function() {
$hlinks.addClass('hidden');
$btn.toggleClass('close');
}, closingTime);
}).on('mouseenter', function() {
// Mouse is back, cancel the timer

View file

@ -4,9 +4,15 @@ permalink: /docs/history/
excerpt: "Change log of enhancements and bug fixes made to the theme."
sidebar:
nav: docs
last_modified_at: 2017-04-21T19:59:55-04:00
last_modified_at: 2017-04-27T15:55:41-04:00
---
## Unreleased
### Bug Fixes
- Toggle close button on `mouseleave`. [#975](https://github.com/mmistakes/minimal-mistakes/issues/975)
## [4.4.1](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.4.1)
### Enhancements

File diff suppressed because one or more lines are too long

View file

@ -46,7 +46,9 @@ $(document).ready(function(){
$btn.attr("count", numOfItems - numOfVisibleItems);
if (numOfVisibleItems === numOfItems) {
$btn.addClass('hidden');
} else $btn.removeClass('hidden');
} else {
$btn.removeClass('hidden');
}
}
// Window listeners
@ -64,6 +66,7 @@ $(document).ready(function(){
// Mouse has left, start the timer
timer = setTimeout(function() {
$hlinks.addClass('hidden');
$btn.toggleClass('close');
}, closingTime);
}).on('mouseenter', function() {
// Mouse is back, cancel the timer