浏览代码

Fixed minor bug in shortcut creator

tobychui 4 年之前
父节点
当前提交
7f3bb4cf39
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      web/SystemAO/desktop/shortcutCreator.html

+ 5 - 2
web/SystemAO/desktop/shortcutCreator.html

@@ -207,8 +207,11 @@
             var moduleInfo =  JSON.parse(decodeURIComponent($("#moduleList").val()));
             //Use the startup path for embeded > fw > default
             var moduleIcon = moduleInfo.IconPath;
-            if (imageExists("../../" + moduleIcon.replace("small_icon","desktop_icon"))){
-                moduleIcon = moduleIcon.replace("small_icon","desktop_icon");
+            var moduleIconDir = moduleIcon.split("/");
+            moduleIconDir.pop();
+            moduleIconDir.join("/");
+            if (imageExists("../../" + moduleIconDir + "desktop_icon.png")){
+                moduleIcon = moduleIconDir + "desktop_icon.png";
             }
             generateShortcutFile("module",moduleInfo.Name, moduleInfo.Name, moduleIcon);
             $(".stageTwo").slideUp();