diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php index 1de4fef0176..997132ca132 100644 --- a/htdocs/core/js/lib_foot.js.php +++ b/htdocs/core/js/lib_foot.js.php @@ -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 = \'
'.dol_escape_js($langs->trans('CopiedToClipboard')).'
\'; } else { - lastchild.innerHTML = \''.dol_escape_js($langs->trans('Error')).'\'; + lastchild.innerHTML = \'
'.dol_escape_js($langs->trans('Error')).'
\'; } setTimeout(() => { lastchild.innerHTML = tmp; }, 1000); }); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 98a879410b0..7ee19214c64 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -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 = '<'.$tag.' class="clipboardCPValue hidewithsize">'.dol_escape_htmltag($valuetocopy, 1, 1).''.dol_escape_htmltag($texttoshow, 1, 1).''; + $result = '<'.$tag.' class="clipboardCPValue hidewithsize">'.dol_escape_htmltag($valuetocopy, 1, 1).''.dol_escape_htmltag($texttoshow, 1, 1).''; } else { - $result = '<'.$tag.' class="clipboardCPValue">'.dol_escape_htmltag($valuetocopy, 1, 1).''; + $result = '<'.$tag.' class="clipboardCPValue">'.dol_escape_htmltag($valuetocopy, 1, 1).''; } return $result; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 366e9322dde..91736813d15 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -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 */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 51e625438fd..1acc8e26ed1 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -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 */