1
1
Fork 0

some js fixes - ignore backspace as history selector and cleanup errors closing non-existent menus

This commit is contained in:
friendica 2012-03-31 05:51:56 -07:00
parent d5a31e5791
commit c34a71eba6

View file

@ -16,6 +16,7 @@
document.getElementById(theID).style.display = "none" document.getElementById(theID).style.display = "none"
} }
var src = null; var src = null;
var prev = null; var prev = null;
var livetime = null; var livetime = null;
@ -88,10 +89,12 @@
return false; return false;
}); });
$('html').click(function() { $('html').click(function() {
last_popup_menu.hide(); if(last_popup_menu) {
last_popup_button.removeClass("selected"); last_popup_menu.hide();
last_popup_menu = null; last_popup_button.removeClass("selected");
last_popup_button = null; last_popup_menu = null;
last_popup_button = null;
}
}); });
// fancyboxes // fancyboxes
@ -166,6 +169,12 @@
NavUpdate(); NavUpdate();
// Allow folks to stop the ajax page updates with the pause/break key // Allow folks to stop the ajax page updates with the pause/break key
$(document).keydown(function(event) { $(document).keydown(function(event) {
if(event.keyCode == '8') {
var target = event.target || event.srcElement;
if (!/input|textarea/i.test(target.nodeName)) {
return false;
}
}
if(event.keyCode == '19' || (event.ctrlKey && event.which == '32')) { if(event.keyCode == '19' || (event.ctrlKey && event.which == '32')) {
event.preventDefault(); event.preventDefault();
if(stopped == false) { if(stopped == false) {