You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO(you): code here to reproduce the problem
.d2h-code-side-linenumber, .d2h-code-linenumber{
position: static !important;
}
.d2h-code-side-line, .d2h-code-line{
margin-left: 0px !important;
}
I tried to add position: relative; to the table where contain class d2h-diff-table and it seems to be fixed.
Maybe consider to add position relative on the <table> itself.
<!DOCTYPE html><html><head><metacharset="utf-8"><linkrel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/diff2html/bundles/css/diff2html.min.css" /><style>.wrapper{height:400px;overflow: auto;}</style></head><body><divclass="wrapper"><divid="destination-elem-id"></div></div><scripttype="text/javascript" src="https://cdn.jsdelivr.net/npm/diff2html/bundles/js/diff2html-ui.min.js"></script><script>consttargetElement=document.getElementById('destination-elem-id');constconfiguration={drawFileList: true,matching: 'lines'};constdiffString=`diff --git a/Libraries/Image.php b/Libraries/Image.phpindex 51f2fb1..02029f9 100644--- a/Libraries/Image.php+++ b/Libraries/Image.php@@ -115,6 +115,7 @@ class Image * but it is not original uploaded file that was created before apply watermark.<br> * @param array $options Associative array as options:<br> * \`restrictedFolder\` (array) Set custom restricted folder names to array. For more description please read on \`\Rdb\Modules\RdbCMSA\Libraries\SPLIterators\FilterRestricted->__construct()\`. For default, it is using restricted it \`FilesTrait\`.<br>+ * \`deleteOriginal\` (bool) Set to \`true\` to delete original file, \`false\` to not delete original file. Default is \`true\`.<br> * @return bool Return \`true\` for successfully removed watermark, skipped because there is no backup file (never set watermark before).<br> * Return \`false\` for otherwise. */@@ -154,21 +155,27 @@ class Image } // only successfully copied file process can goes here.- // delete original (backup) file.- $deleteResult = @unlink($originalFile);+ if (!isset($options['deleteOriginal']) || $options['deleteOriginal'] === true) {+ // if delete original+ // delete original (backup) file.+ $deleteResult = @unlink($originalFile);- if (true !== $deleteResult) {- if (isset($Logger)) {- $Logger->write(- 'modules/rdbcmsa/libraries/image/removewatermark',- 2,- 'Unable to delete original file. {file}',- [- 'file' => $originalFile,- ]- );+ if (true !== $deleteResult) {+ if (isset($Logger)) {+ $Logger->write(+ 'modules/rdbcmsa/libraries/image/removewatermark',+ 2,+ 'Unable to delete original file. {file}',+ [+ 'file' => $originalFile,+ ]+ );+ } }- }+ } else {+ // if not delete original+ $deleteResult = true;+ }// endif delete original unset($Logger, $originalFile); return ($copyResult === true && $deleteResult === true);@@ -241,6 +248,11 @@ class Image if (!$this->Container instanceof \Rdb\System\Container) { throw new \RuntimeException('The property \`Container\` must be set.'); }++ if (!is_file($file)) {+ // if file was not found.+ return false;+ } if (!isset($options['returnFullPath'])) { $options['returnFullPath'] = true;@@ -401,8 +413,8 @@ class Image $Image->png_quality = (isset($options['png_quality']) && is_int($options['png_quality']) ? $options['png_quality'] : 5); unset($originalFile);- $doWatermark = $Image->watermarkImage($watermarkFile, 'center', 'middle'); $doResize = $Image->resize(2000, 2000);+ $doWatermark = $Image->watermarkImage($watermarkFile, 'center', 'middle'); $doSave = $Image->save($file); $Image->clear(); unset($watermarkFile);`;constdiff2htmlUi=newDiff2HtmlUI(targetElement,diffString,configuration);diff2htmlUi.draw();</script></body></html>
The problem is that it does not support scroll in the tables. At the moment that seems not to be easy to accomplish.
If you have a full solution that does not break other parts feel free to send a PR.
But take into consideration that usually adding relatives will break the line numbers.
Activity
BennieMeng commentedon Dec 19, 2018
should we remove the position: absolute; and padding-right attribute?
rtfpessoa commentedon Dec 22, 2018
@BennieMeng I started doing some work a while ago in https://github.com/rtfpessoa/diff2html/pull/180/files can you try that css?
BennieMeng commentedon Dec 24, 2018
it looks good by your change, i will try it when package updated.
rtfpessoa commentedon Jan 4, 2019
@BennieMeng please check version 2.6.0
rtfpessoa commentedon Jan 5, 2019
Closing this for now. If needed we can reopen.
ve3 commentedon Jul 3, 2021
This happens again in v3.4.5
I tried to add
position: relative;to the table where contain classd2h-diff-tableand it seems to be fixed.Maybe consider to add position relative on the
<table>itself.rtfpessoa commentedon Jul 9, 2021
@ve3 can you provide an example to replicate?
ve3 commentedon Jul 9, 2021
rtfpessoa commentedon Jul 9, 2021
The problem is that it does not support scroll in the tables. At the moment that seems not to be easy to accomplish.
If you have a full solution that does not break other parts feel free to send a PR.
But take into consideration that usually adding relatives will break the line numbers.
ve3 commentedon Jul 9, 2021
I have tried add position relation to
d2h-diff-tableclass and it's working perfectly.Just position absolute without relative in the parent is not flexible at all.