Skip to content

Commit

Permalink
Add visibility check back to can show #2842
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukic committed Aug 13, 2015
1 parent d649872 commit 2e27d00
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions src/definitions/modules/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ $.fn.search = function(parameters) {
return $.fn.api !== undefined;
},
show: function() {
return !module.is.visible() && module.is.focused() && !module.is.empty();
return module.is.focused() && !module.is.visible() && !module.is.empty();
},
transition: function() {
return settings.transition && $.fn.transition !== undefined && $module.transition('is supported');
Expand Down Expand Up @@ -763,26 +763,28 @@ $.fn.search = function(parameters) {
},

showResults: function() {
if( module.can.transition() ) {
module.debug('Showing results with css animations');
$results
.transition({
animation : settings.transition + ' in',
debug : settings.debug,
verbose : settings.verbose,
duration : settings.duration,
queue : true
})
;
}
else {
module.debug('Showing results with javascript');
$results
.stop()
.fadeIn(settings.duration, settings.easing)
;
if(!module.is.visible()) {
if( module.can.transition() ) {
module.debug('Showing results with css animations');
$results
.transition({
animation : settings.transition + ' in',
debug : settings.debug,
verbose : settings.verbose,
duration : settings.duration,
queue : true
})
;
}
else {
module.debug('Showing results with javascript');
$results
.stop()
.fadeIn(settings.duration, settings.easing)
;
}
settings.onResultsOpen.call($results);
}
settings.onResultsOpen.call($results);
},
hideResults: function() {
if( module.is.visible() ) {
Expand Down

0 comments on commit 2e27d00

Please sign in to comment.