css for toolitp

This commit is contained in:
Laurent Destailleur 2021-10-24 16:35:42 +02:00
parent e8e63e85f1
commit b8250be237
4 changed files with 52 additions and 5 deletions

View File

@ -258,12 +258,12 @@ print '
window.getSelection().removeAllRanges();
/* Show message */
var lastchild = this.parentNode.lastChild;
var lastchild = this.parentNode.lastChild; /* .parentNode is clipboardCP and last child is clipboardCPText */
var tmp = lastchild.innerHTML
if (succeed) {
lastchild.innerHTML = \''.dol_escape_js($langs->trans('CopiedToClipboard')).'\';
lastchild.innerHTML = \'<div class="clipboardCPTextDivInside opacitymedium">'.dol_escape_js($langs->trans('CopiedToClipboard')).'</div>\';
} else {
lastchild.innerHTML = \''.dol_escape_js($langs->trans('Error')).'\';
lastchild.innerHTML = \'<div class="clipboardCPTextDivInside opacitymedium">'.dol_escape_js($langs->trans('Error')).'</div>\';
}
setTimeout(() => { lastchild.innerHTML = tmp; }, 1000);
});

View File

@ -10520,9 +10520,9 @@ function showValueWithClipboardCPButton($valuetocopy, $showonlyonhover = 1, $tex
$tag = 'span'; // Using div does not work when using the js copy code.
if ($texttoshow) {
$result = '<span class="clipboardCP'.($showonlyonhover ? ' clipboardCPShowOnHover' : '').'"><'.$tag.' class="clipboardCPValue hidewithsize">'.dol_escape_htmltag($valuetocopy, 1, 1).'</'.$tag.'><span class="clipboardCPValueToPrint">'.dol_escape_htmltag($texttoshow, 1, 1).'</span><span class="clipboardCPButton far fa-clipboard opacitymedium paddingleft paddingright"></span><span class="clipboardCPText opacitymedium"></span></span>';
$result = '<span class="clipboardCP'.($showonlyonhover ? ' clipboardCPShowOnHover' : '').'"><'.$tag.' class="clipboardCPValue hidewithsize">'.dol_escape_htmltag($valuetocopy, 1, 1).'</'.$tag.'><span class="clipboardCPValueToPrint">'.dol_escape_htmltag($texttoshow, 1, 1).'</span><span class="clipboardCPButton far fa-clipboard opacitymedium paddingleft paddingright"></span><span class="clipboardCPText"></span></span>';
} else {
$result = '<span class="clipboardCP'.($showonlyonhover ? ' clipboardCPShowOnHover' : '').'"><'.$tag.' class="clipboardCPValue">'.dol_escape_htmltag($valuetocopy, 1, 1).'</'.$tag.'><span class="clipboardCPButton far fa-clipboard opacitymedium paddingleft paddingright"></span><span class="clipboardCPText opacitymedium"></span></span>';
$result = '<span class="clipboardCP'.($showonlyonhover ? ' clipboardCPShowOnHover' : '').'"><'.$tag.' class="clipboardCPValue">'.dol_escape_htmltag($valuetocopy, 1, 1).'</'.$tag.'><span class="clipboardCPButton far fa-clipboard opacitymedium paddingleft paddingright"></span><span class="clipboardCPText"></span></span>';
}
return $result;

View File

@ -6879,6 +6879,29 @@ div.clipboardCPValue.hidewithsize {
display: none;
}
/* To make a div popup, we must use a position aboluste inside a position relative */
.clipboardCPText {
position: relative;
}
.clipboardCPTextDivInside {
position: absolute;
background: #f8f8fa;
color: #888;
border: 1px solid #E0E0E0;
opacity: 1;
z-index: 20;
padding: 2px;
padding-left: 5px;
padding-right: 5px;
top: -5px;
left: 0px;
border-radius: 5px;
white-space: nowrap;
font-size: 0.9em;
box-shadow: 1px 1px 6px #ddd;
}
/* ============================================================================== */
/* CSS style used for small screen */

View File

@ -6717,6 +6717,30 @@ div.clipboardCPValue.hidewithsize {
display: none;
}
/* To make a div popup, we must use a position aboluste inside a position relative */
.clipboardCPText {
position: relative;
}
.clipboardCPTextDivInside {
position: absolute;
background: #EEE;
color: 888;
border: 1px solid #DDD;
opacity: 1;
z-index: 20;
padding: 2px;
padding-left: 4px;
padding-right: 4px;
top: -5px;
left: 0px;
border-radius: 5px;
white-space: nowrap;
font-size: 0.95em;
box-shadow: 1px 1px 6px #ddd;
}
/* ============================================================================== */
/* CSS style used for small screen */