fix key shortcuts
This commit is contained in:
@@ -669,7 +669,7 @@ $(function() {
|
||||
if ($("#c-posts").length && $("#a-show").length && $("#image").length) {
|
||||
if ($("#note-locked-notice").length == 0) {
|
||||
$("#translate").bind("click", Danbooru.Note.TranslationMode.toggle);
|
||||
$(document).bind("keydown", "n", Danbooru.Note.TranslationMode.toggle);
|
||||
$(document).bind("keypress", "n", Danbooru.Note.TranslationMode.toggle);
|
||||
}
|
||||
Danbooru.Note.load_all();
|
||||
$("#image").click(Danbooru.Note.Box.toggle_all);
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
$(function() {
|
||||
if ($(".paginator").length && (Danbooru.meta("enable-js-navigation") === "true")) {
|
||||
$(document).bind("keydown", "d", Danbooru.Paginator.next_page);
|
||||
$(document).bind("keydown", "a", Danbooru.Paginator.prev_page);
|
||||
$(document).bind("keypress", "d", Danbooru.Paginator.next_page);
|
||||
$(document).bind("keypress", "a", Danbooru.Paginator.prev_page);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
Danbooru.PostPopular.initialize_all = function() {
|
||||
if ($("#c-explore-posts").length) {
|
||||
if (Danbooru.meta("enable-js-navigation") === "true") {
|
||||
$(document).bind("keydown", "a", function(e) {
|
||||
$(document).bind("keypress", "a", function(e) {
|
||||
Danbooru.PostPopular.nav_prev();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$(document).bind("keydown", "d", function(e) {
|
||||
$(document).bind("keypress", "d", function(e) {
|
||||
Danbooru.PostPopular.nav_next();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
@@ -135,23 +135,23 @@
|
||||
|
||||
Danbooru.Post.initialize_shortcuts = function() {
|
||||
if ($("#a-show").length) {
|
||||
$(document).bind("keydown", "e", function(e) {
|
||||
$(document).bind("keypress", "e", function(e) {
|
||||
$("#post-edit-link").trigger("click");
|
||||
$("#post_tag_string").focus();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$(document).bind("keydown", "a", function(e) {
|
||||
$(document).bind("keypress", "a", function(e) {
|
||||
Danbooru.Post.nav_prev();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$(document).bind("keydown", "d", function(e) {
|
||||
$(document).bind("keypress", "d", function(e) {
|
||||
Danbooru.Post.nav_next();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$(document).bind("keydown", "f", function(e) {
|
||||
$(document).bind("keypress", "f", function(e) {
|
||||
$("#add-to-favorites:visible").trigger("click");
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
Danbooru.Shortcuts = {};
|
||||
|
||||
Danbooru.Shortcuts.initialize = function() {
|
||||
$(document).bind("keydown", "s", function(e) {
|
||||
$(document).bind("keypress", "s", function(e) {
|
||||
Danbooru.Shortcuts.nav_scroll_down();
|
||||
});
|
||||
|
||||
$(document).bind("keydown", "w", function(e) {
|
||||
$(document).bind("keypress", "w", function(e) {
|
||||
Danbooru.Shortcuts.nav_scroll_up();
|
||||
});
|
||||
|
||||
$(document).bind("keydown", "q", function(e) {
|
||||
$(document).bind("keypress", "q", function(e) {
|
||||
$("#tags, #search_name, #search_name_matches, #query").trigger("focus").selectEnd();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user