function setupHandlersPanel() { $("#newHandler") .dialog({ autoOpen: false, title: "Create new handler", height: "auto", width: "auto", autoResize: true, resizable: false, modal: true, closeOnEscase: true, draggable: false, open: function() { $("input").val(""); $(".ui-state-error").hide(); $(this) .find("input:visible") .first() .focus(); if ($(this).data("vp3Action") !== "create") $(this).dialog("option", "title", "Create new handler from template '" + $(this).data("vp3HandlerName") + "'"); let $hTemplates = $("#handlerTemplates"); if (gHandlertemplates.length) { $.each(gHandlertemplates, (i, t) => { $hTemplates.append($("