From 468600971e6f87012fbe52cc7a098f3bd0cf6f38 Mon Sep 17 00:00:00 2001 From: fofolee Date: Mon, 13 Jul 2020 23:18:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=B0=E5=A2=9E=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E5=90=8E=E7=95=8C=E9=9D=A2=E8=B7=B3=E8=87=B3=E9=A1=B6?= =?UTF-8?q?=E7=AB=AF=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/options.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/assets/options.js b/src/assets/options.js index 9f6d3c2..2713369 100644 --- a/src/assets/options.js +++ b/src/assets/options.js @@ -225,7 +225,7 @@ var platformIcons if (features.platform) platformIcons = features.platform.map(x => ``) else platformIcons = ['', '', ''] - featureList += ` + featureList += `
${features.explain}
@@ -238,15 +238,15 @@ ${cmds} - - - ${tag == "默认" ? "" : ``} + + + ${tag == "默认" ? "" : ``} ` }) featureList += `` @@ -605,7 +605,7 @@ // 开关 $("#options").on('change', 'input[type=checkbox]', function () { var customFts = getDB('customFts'), - code = $(this).attr('id'); + code = $(this).parents('tr').attr('id') if (!utools.removeFeature(code)) { utools.setFeature(customFts[code].features); } @@ -635,7 +635,7 @@ // 编辑 $("#options").on('click', '.editBtn', function () { var readonly = false, - code = $(this).attr('code'), + code = $(this).parents('tr').attr('id'), data = utools.db.get("customFts").data[code], cmds = data.features.cmds[0], platform = data.features.platform; @@ -736,7 +736,7 @@ // 导出 $("#options").on('click', '.exportBtn', function () { - var code = $(this).attr('code'), + var code = $(this).parents('tr').attr('id'), json = getDB('customFts')[code], options = { title: '选择保存位置', @@ -760,7 +760,7 @@ cancelButtonText: '手抖...', }).then((result) => { if (result.value) { - var code = $(this).attr('code'), + var code = $(this).parents('tr').attr('id'), db = utools.db.get("customFts"), data = db.data; delete data[code]; @@ -774,7 +774,7 @@ }) // 选择图标 - $("#options").on('click', '#icon, #iconame', function () { + $("#options").on('click', '#icon', function () { var options = { buttonLabel: '选择', filters: [{ @@ -907,11 +907,9 @@ redirectTag = "未分类" } showOptions(redirectTag); + location.href = '#' + code $("#customize").empty() - $(`#${code}`).click(); - if (!$(`#${code}`).is(':checked')) { - $(`#${code}`).click(); - } + $(`#${code} .checked-switch`).is(':checked') || $(`#${code} .checked-switch`).click() }); } }