Skip to content

Commit

Permalink
Padding and timeout.
Browse files Browse the repository at this point in the history
  • Loading branch information
rchern committed Dec 11, 2010
1 parent 093388f commit c4f05fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SEKeyboardShortcuts.user.js
Expand Up @@ -40,9 +40,9 @@ with_jquery(function ($) {
return this.each(function () {
$(this).bind('keyup', function (event) {
if (this !== event.target && (/textarea|select/i.test(event.target.nodeName) || event.target.type === "text")) { return; }
if (event.keyCode == params.code[params.step]) { params.step++; }
if (event.keyCode == params.code[params.step]) { if (params.step == 0) { params.startTime = new Date(); } params.step++; }
else { params.step = 0; }
if (params.step == params.code.length) { fn(); params.step = 0; }
if (params.step == params.code.length) { if (new Date() - params.startTime <= 2E3) { fn(); } params.step = 0; }
});
});
};
Expand All @@ -53,7 +53,7 @@ with_jquery(function ($) {

var selectPost = function (i) {
i = i % posts.length;
selectedPost = posts.css("border", "").eq(i);
selectedPost = posts.css("padding", "5px").css("border", "1px solid " + $("#content").css("backgroundColor")).eq(i);
selectedPost.css("border", "1px dashed black");
//$.scrollTop(posts.eq(i).position().y);
};
Expand Down

0 comments on commit c4f05fd

Please sign in to comment.