mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-08 22:51:25 +08:00
showSelectList 弃用 closeOnSelect 参数
This commit is contained in:
parent
b248980bc6
commit
b09abf72e7
@ -164,7 +164,6 @@ quickcommand = {
|
|||||||
opt.optionType || (opt.optionType = 'plaintext')
|
opt.optionType || (opt.optionType = 'plaintext')
|
||||||
typeof opt.placeholder == 'undefined' && (opt.placeholder = "搜索,支持拼音")
|
typeof opt.placeholder == 'undefined' && (opt.placeholder = "搜索,支持拼音")
|
||||||
typeof opt.enableSearch == 'undefined' && (opt.enableSearch = true)
|
typeof opt.enableSearch == 'undefined' && (opt.enableSearch = true)
|
||||||
typeof opt.closeOnSelect == 'undefined' && (opt.closeOnSelect = true)
|
|
||||||
if ($('#quickselect').length) $('#quickselect').remove()
|
if ($('#quickselect').length) $('#quickselect').remove()
|
||||||
$("body").append(`<div id="quickselect"><select id="selectBox"></select></div>`)
|
$("body").append(`<div id="quickselect"><select id="selectBox"></select></div>`)
|
||||||
let item, data = []
|
let item, data = []
|
||||||
@ -187,7 +186,6 @@ quickcommand = {
|
|||||||
// data: data,
|
// data: data,
|
||||||
width: "100%",
|
width: "100%",
|
||||||
dropdownParent: $("#quickselect"),
|
dropdownParent: $("#quickselect"),
|
||||||
closeOnSelect: opt.closeOnSelect,
|
|
||||||
// 支持无限滚动
|
// 支持无限滚动
|
||||||
ajax: {
|
ajax: {
|
||||||
transport: (params, success, failure) => {
|
transport: (params, success, failure) => {
|
||||||
@ -223,12 +221,10 @@ quickcommand = {
|
|||||||
$('#selectBox').on('select2:select', function (e) {
|
$('#selectBox').on('select2:select', function (e) {
|
||||||
let result = $('#selectBox').data('options')[$(this).val()]
|
let result = $('#selectBox').data('options')[$(this).val()]
|
||||||
delete result.selected
|
delete result.selected
|
||||||
|
$('#selectBox').off('select2:select')
|
||||||
|
utools.removeSubInput()
|
||||||
|
$("#quickselect").remove()
|
||||||
reslove(result)
|
reslove(result)
|
||||||
if (opt.closeOnSelect) {
|
|
||||||
$('#selectBox').off('select2:select')
|
|
||||||
utools.removeSubInput()
|
|
||||||
$("#quickselect").remove()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user