优化入仓码查询入口与卡片交互
This commit is contained in:
@@ -1,5 +1,26 @@
|
||||
// Shared controls for the customer page and service workspace.
|
||||
var SupportUI = {
|
||||
async copyText(text){
|
||||
try{
|
||||
if(navigator.clipboard && navigator.clipboard.writeText){
|
||||
await navigator.clipboard.writeText(text);
|
||||
return true;
|
||||
}
|
||||
}catch(error){}
|
||||
const field = document.createElement('textarea');
|
||||
field.value=text; field.readOnly=true;
|
||||
field.style.position='fixed'; field.style.opacity='0';
|
||||
const previous=document.activeElement;
|
||||
document.body.appendChild(field);
|
||||
try{
|
||||
field.focus({preventScroll:true}); field.select();
|
||||
return Boolean(document.execCommand('copy'));
|
||||
}catch(error){ return false; }
|
||||
finally{
|
||||
field.remove();
|
||||
if(previous && previous.isConnected) previous.focus({preventScroll:true});
|
||||
}
|
||||
},
|
||||
initAttachments(container, label){
|
||||
container.addEventListener('error', function(event){
|
||||
const image = event.target;
|
||||
|
||||
Reference in New Issue
Block a user