From cd1aba3c058751b7a0f25cbbd48be17fe99685d6 Mon Sep 17 00:00:00 2001 From: fofolee Date: Thu, 25 Jun 2020 20:14:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B6=88=E6=81=AF=E5=BC=B9?= =?UTF-8?q?=E6=A1=86api=EF=BC=8C=E9=80=89=E6=8B=A9=E5=88=97=E8=A1=A8api?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/preload.js | 46 +++++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/src/preload.js b/src/preload.js index 59f91f2..e37dfa2 100644 --- a/src/preload.js +++ b/src/preload.js @@ -107,18 +107,18 @@ const quickcommand = { swalOneByOne(options) }, - showSelectBox: function (callback, selects) { + showSelectBox: function (callback, selects, placeholder = "搜索") { let helps = `正确用法: quickcommand.showSelectBox(choise => { var index = choise.index var text = choise.text //do something... - }, [option1, option2...])` + }, [option1, option2...], placeholder)` if (!(callback instanceof Function)) throw helps if (!(selects instanceof Array) || (selects && !selects.length)) throw helps // 调整插件高度 let modWindowHeight = num => { - if(!$("#customize").is(":parent")) utools.setExpendHeight(num > 11 ? 600 : 50 * (num + 1)); + if(!$("#customize").is(":parent")) utools.setExpendHeight(num > 10 ? 550 : 50 * num); } var html = `