Commit 87b485f3 authored by Kjetil Thuen's avatar Kjetil Thuen

Immediately hide expander on scroll on ios

parent a1c0379d
......@@ -22,7 +22,7 @@ var register_event_handlers = function() {
jQuery(window).bind('scrollstart', function(){
if (scrollListenersEnabled) {
scrollInProgress = true;
console.log("scrollstart");
// console.log("scrollstart");
$('#expander:visible').slideUp();
}
});
......@@ -31,14 +31,14 @@ var register_event_handlers = function() {
//IOS specific touch event
if (scrollListenersEnabled) {
scrollInProgress = true;
console.log("touchmove");
$('#expander:visible').slideUp();
// console.log("touchmove");
$('#expander:visible').hide();
}
});
jQuery(window).bind('scrollstop', function(e){
if (scrollInProgress) {
console.log("scrollstop");
// console.log("scrollstop");
find_and_select_element();
}
});
......@@ -55,8 +55,7 @@ var register_event_handlers = function() {
};
var show_expanded_info = function() {
console.log("expanding");
console.log("-------------------------");
// console.log("expanding");
var listElem = $('#studies_list li.selected');
scrollListenersEnabled = false;
$('html:not(:animated),body:not(:animated)').animate({scrollTop: scrollVal}, 'fast', function() {
......@@ -68,6 +67,7 @@ var show_expanded_info = function() {
$('#expander').slideDown('fast', function() {
scrollListenersEnabled = true;
scrollInProgress = false;
inScroll = false;
});
}
});
......@@ -94,10 +94,9 @@ var set_selected_element = function (element) {
focusedListElement = listElem;
scrollVal = listElem.offset().top - $('#studies_list').position().top;
console.log("Debouncing expand function");
// console.log("Debouncing expand function");
debounce(show_expanded_info, 500, false)();
} else {
console.log("Not a list element, hiding");
$('#expander').hide();
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment