hotkeys: refactor to use .on(), namespaces.
* Use .on() instead of .bind() because bind is deprecated in jquery 3.0.
* Ensure enable-js-navigation is always respected.
* Namespace keybindings so they may be disabled by userscripts with
e.g. $(document).off("keydown.danbooru") or $(document).off("next_page").
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
}
|
||||
|
||||
Danbooru.PostModeMenu.initialize_shortcuts = function() {
|
||||
$(document).bind("keydown", "1 2 3 4 5 6 7 8 9 0", Danbooru.PostModeMenu.change_tag_script);
|
||||
Danbooru.keydown("1 2 3 4 5 6 7 8 9 0", "change_tag_script", Danbooru.PostModeMenu.change_tag_script);
|
||||
}
|
||||
|
||||
Danbooru.PostModeMenu.show_notice = function(i) {
|
||||
|
||||
Reference in New Issue
Block a user