From b484b973d93769598b0bf9ac6a37fa540f43a47c Mon Sep 17 00:00:00 2001 From: ebolam Date: Thu, 4 Aug 2022 19:26:55 -0400 Subject: [PATCH] Fix for custom model box not showing up in model load menu if there aren't any models in the model folder --- static/application.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/static/application.js b/static/application.js index b354f419..952a5aa7 100644 --- a/static/application.js +++ b/static/application.js @@ -1048,6 +1048,18 @@ function buildLoadModelList(ar, menu, breadcrumbs, showdelete) { if (breadcrumbs.length > 0) { $("#loadmodellistbreadcrumbs").append("
") } + //If we're in the custom load menu (we need to send the path data back in that case) + if(['NeoCustom', 'GPT2Custom'].includes(menu)) { + $("#loadmodel"+i).off("click").on("click", (function () { + return function () { + socket.send({'cmd': 'selectmodel', 'data': $(this).attr("name"), 'path': $(this).attr("pretty_name")}); + highlightLoadLine($(this)); + } + })(i)); + $("#custommodelname").removeClass("hidden"); + $("#custommodelname")[0].setAttribute("menu", menu); + } + for(i=0; i