mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-09 23:16:18 +08:00
fix: 解决 mac 失焦问题
This commit is contained in:
parent
438140b91b
commit
9f2ac5cf88
@ -45,17 +45,17 @@ import qcparser from "./qcparser.js"
|
|||||||
})
|
})
|
||||||
// 配置页面
|
// 配置页面
|
||||||
if (code == 'options') {
|
if (code == 'options') {
|
||||||
utools.setExpendHeight(600);
|
utools.setExpendHeight(550);
|
||||||
$("#quickpanel").hide()
|
$("#quickpanel").hide()
|
||||||
// $("#options").show();
|
// $("#options").show();
|
||||||
qcfeatures.showFeatureList();
|
qcfeatures.showFeatureList();
|
||||||
} else if (code == 'code') {
|
} else if (code == 'code') {
|
||||||
var file = ""
|
var file = ""
|
||||||
// utools.setExpendHeight(600);
|
// utools.setExpendHeight(550);
|
||||||
if (type == 'files') file = payload[0].path
|
if (type == 'files') file = payload[0].path
|
||||||
qccommands.showCodeEditor(file)
|
qccommands.showCodeEditor(file)
|
||||||
} else if (code == 'newcommand') {
|
} else if (code == 'newcommand') {
|
||||||
utools.setExpendHeight(600)
|
utools.setExpendHeight(550)
|
||||||
$("#quickpanel").hide()
|
$("#quickpanel").hide()
|
||||||
$("#options").empty().fadeIn();
|
$("#options").empty().fadeIn();
|
||||||
let qc = { "program": "quickcommand", "cmd": "", "output": "ignore" }
|
let qc = { "program": "quickcommand", "cmd": "", "output": "ignore" }
|
||||||
@ -65,7 +65,7 @@ import qcparser from "./qcparser.js"
|
|||||||
}
|
}
|
||||||
qccommands.editCurrentCommand(qc, false)
|
qccommands.editCurrentCommand(qc, false)
|
||||||
} else if (code.slice(0, 6) == 'panel_') {
|
} else if (code.slice(0, 6) == 'panel_') {
|
||||||
utools.setExpendHeight(600)
|
utools.setExpendHeight(550)
|
||||||
qcpanel.showPanel(hexDecode(code.slice(6)))
|
qcpanel.showPanel(hexDecode(code.slice(6)))
|
||||||
} else {
|
} else {
|
||||||
// console.log(new Date().getTime() - window.startTime);
|
// console.log(new Date().getTime() - window.startTime);
|
||||||
|
@ -120,7 +120,7 @@ let getSharedQCFromYuQue = async () => {
|
|||||||
$('#options').show()
|
$('#options').show()
|
||||||
$('#customize').removeData('returnShare')
|
$('#customize').removeData('returnShare')
|
||||||
}
|
}
|
||||||
utools.setExpendHeight(600)
|
utools.setExpendHeight(550)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -85,7 +85,7 @@ quickcommand = {
|
|||||||
showInputBox: function (placeHolders = [""], title = '') {
|
showInputBox: function (placeHolders = [""], title = '') {
|
||||||
return new Promise((reslove, reject) => {
|
return new Promise((reslove, reject) => {
|
||||||
if (!(placeHolders instanceof Array)) placeHolders = [placeHolders.toString()]
|
if (!(placeHolders instanceof Array)) placeHolders = [placeHolders.toString()]
|
||||||
utools.setExpendHeight(600)
|
utools.setExpendHeight(550)
|
||||||
var html = ""
|
var html = ""
|
||||||
var inputBoxNumbers = placeHolders.length
|
var inputBoxNumbers = placeHolders.length
|
||||||
for (let i = 0; i < inputBoxNumbers; i++) {
|
for (let i = 0; i < inputBoxNumbers; i++) {
|
||||||
@ -98,7 +98,7 @@ quickcommand = {
|
|||||||
$('.swal2-content').keydown(function (e) {
|
$('.swal2-content').keydown(function (e) {
|
||||||
e.which == 13 && swal.clickConfirm()
|
e.which == 13 && swal.clickConfirm()
|
||||||
})
|
})
|
||||||
$(".output").is(":parent") ? utools.setExpendHeight(600) : modWindowHeight($('.swal2-popup').outerHeight() + 20)
|
$(".output").is(":parent") ? utools.setExpendHeight(550) : modWindowHeight($('.swal2-popup').outerHeight() + 20)
|
||||||
},
|
},
|
||||||
title: title,
|
title: title,
|
||||||
html: html,
|
html: html,
|
||||||
@ -120,7 +120,7 @@ quickcommand = {
|
|||||||
showButtonBox: function (buttons, title = '') {
|
showButtonBox: function (buttons, title = '') {
|
||||||
return new Promise((reslove, reject) => {
|
return new Promise((reslove, reject) => {
|
||||||
if (!(buttons instanceof Array)) return reject(new TypeError(`应为 Array, 而非 ${typeof buttons}`))
|
if (!(buttons instanceof Array)) return reject(new TypeError(`应为 Array, 而非 ${typeof buttons}`))
|
||||||
utools.setExpendHeight(600)
|
utools.setExpendHeight(550)
|
||||||
var html = ``
|
var html = ``
|
||||||
var buttonBoxNumbers = buttons.length
|
var buttonBoxNumbers = buttons.length
|
||||||
for (let i = 0; i < buttonBoxNumbers; i++) {
|
for (let i = 0; i < buttonBoxNumbers; i++) {
|
||||||
@ -132,7 +132,7 @@ quickcommand = {
|
|||||||
reslove({ id: i, text: buttons[i] })
|
reslove({ id: i, text: buttons[i] })
|
||||||
swal.clickConfirm()
|
swal.clickConfirm()
|
||||||
}
|
}
|
||||||
$(".output").is(":parent") && utools.setExpendHeight(600) || modWindowHeight($('.swal2-popup').outerHeight() + 20)
|
$(".output").is(":parent") && utools.setExpendHeight(550) || modWindowHeight($('.swal2-popup').outerHeight() + 20)
|
||||||
},
|
},
|
||||||
html: html,
|
html: html,
|
||||||
title: title,
|
title: title,
|
||||||
@ -270,7 +270,7 @@ quickcommand = {
|
|||||||
// 显示文本输入框
|
// 显示文本输入框
|
||||||
showTextAera: function (placeholder = "", value = "") {
|
showTextAera: function (placeholder = "", value = "") {
|
||||||
return new Promise((reslove, reject) => {
|
return new Promise((reslove, reject) => {
|
||||||
utools.setExpendHeight(600)
|
utools.setExpendHeight(550)
|
||||||
var html = `
|
var html = `
|
||||||
<div id="quicktextarea">
|
<div id="quicktextarea">
|
||||||
<textarea placeholder="${placeholder}">${value}</textarea>
|
<textarea placeholder="${placeholder}">${value}</textarea>
|
||||||
@ -296,7 +296,7 @@ quickcommand = {
|
|||||||
confirmButtonText: '确定!',
|
confirmButtonText: '确定!',
|
||||||
cancelButtonText: '手抖...'
|
cancelButtonText: '手抖...'
|
||||||
}
|
}
|
||||||
utools.setExpendHeight(600)
|
utools.setExpendHeight(550)
|
||||||
let result = await Swal.fire(options)
|
let result = await Swal.fire(options)
|
||||||
if (result.value) return true;
|
if (result.value) return true;
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user