From c84371a6c9dfbb6fd51e0b51ffd7a64e4a284d05 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 29 Jan 2018 17:02:32 +0100 Subject: [PATCH] jsTree: keine globalen Key-Handler installieren MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Sollen wohl für Keyboard-Navigation im Baum sorgen — obwohl es dafür extra ein jsTree-Plugin gibt. Leider kollidiert der Handler für Space mit der Art, wie das inline_resize-Plugin des ckEditors seine Handler registriert. Effekt war, dass die Leertaste dann nicht mehr beim ckEditor ankam. Behebt #306. --- js/jquery.jstree.js | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/js/jquery.jstree.js b/js/jquery.jstree.js index c92c2acd6..b7fa78de0 100644 --- a/js/jquery.jstree.js +++ b/js/jquery.jstree.js @@ -3646,49 +3646,6 @@ }) .appendTo("body"); $(document).bind("mousedown", function (e) { if($.vakata.context.vis && !$.contains($.vakata.context.cnt[0], e.target)) { $.vakata.context.hide(); } }); - if(typeof $.hotkeys !== "undefined") { - $(document) - .bind("keydown", "up", function (e) { - if($.vakata.context.vis) { - var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first(); - if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last(); } - o.addClass("vakata-hover"); - e.stopImmediatePropagation(); - e.preventDefault(); - } - }) - .bind("keydown", "down", function (e) { - if($.vakata.context.vis) { - var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first(); - if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first(); } - o.addClass("vakata-hover"); - e.stopImmediatePropagation(); - e.preventDefault(); - } - }) - .bind("keydown", "right", function (e) { - if($.vakata.context.vis) { - $.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover"); - e.stopImmediatePropagation(); - e.preventDefault(); - } - }) - .bind("keydown", "left", function (e) { - if($.vakata.context.vis) { - $.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover"); - e.stopImmediatePropagation(); - e.preventDefault(); - } - }) - .bind("keydown", "esc", function (e) { - $.vakata.context.hide(); - e.preventDefault(); - }) - .bind("keydown", "space", function (e) { - $.vakata.context.cnt.find(".vakata-hover").last().children("a").click(); - e.preventDefault(); - }); - } }); $.jstree.plugin("contextmenu", { -- 2.20.1