Author: blabno
Date: 2011-12-17 14:05:18 -0500 (Sat, 17 Dec 2011)
New Revision: 23096
Modified:
sandbox/trunk/ui/accesskeyhelper/ui/src/main/resources/META-INF/resources/jquery.accesskey.js
Log:
Fixed quick show/hide bug of accesskeyhelper.
Modified:
sandbox/trunk/ui/accesskeyhelper/ui/src/main/resources/META-INF/resources/jquery.accesskey.js
===================================================================
---
sandbox/trunk/ui/accesskeyhelper/ui/src/main/resources/META-INF/resources/jquery.accesskey.js 2011-12-17
18:56:20 UTC (rev 23095)
+++
sandbox/trunk/ui/accesskeyhelper/ui/src/main/resources/META-INF/resources/jquery.accesskey.js 2011-12-17
19:05:18 UTC (rev 23096)
@@ -73,21 +73,22 @@
var hints = (function() {
var body = $('body');
var shown = false;
+ var timeoutId;
+ var keydownHandler = function() {
+ api.hide();
+ };
var api = {
'show': function() {
body.addClass('accesskey-shown');
shown = true;
if (options.hideOnAnyKey) {
- var keydownHandler = function() {
- api.hide();
- $(window).unbind("keydown", keydownHandler);
- };
$(window).keydown(keydownHandler);
}
},
'hide': function() {
body.removeClass('accesskey-shown');
- shown = false
+ shown = false;
+ $(window).unbind("keydown", keydownHandler);
},
'shown': function() {
return shown
@@ -98,7 +99,10 @@
return true;
}
api.show();
- setTimeout(function() {
+ if (timeoutId != null) {
+ clearTimeout(timeoutId);
+ }
+ timeoutId = setTimeout(function() {
api.hide();
}, options.timeout);
};
Show replies by date