This commit is contained in:
wangyidong
2021-03-31 10:38:52 +08:00
parent e61b1780f6
commit ddf27f277d
3 changed files with 34 additions and 2 deletions

View File

@@ -1 +1,2 @@
.c-desc {overflow-x: scroll;}
.table td.c-desc div {height: 25px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; float: left; max-width: calc(100% - 20px);}
.table td.c-desc .more {height: 25px; float: left;}

View File

@@ -7,4 +7,32 @@ $(function()
$(this).parent().toggleClass('active');
});
}
$('#suiteList tbody tr').each(function()
{
var $content = $(this).find('td.c-desc');
var content = $content.find('div').html();
if(content.indexOf('<br') >= 0)
{
$content.append("<a href='###' class='more'><i class='icon icon-chevron-double-down'></i></a>");
}
});
})
$(document).on('click', 'td.c-desc .more', function(e)
{
var $toggle = $(this);
if($toggle.hasClass('open'))
{
$toggle.removeClass('open');
$toggle.closest('.c-desc').find('div').css('height', '25px');
$toggle.css('padding-top', 0);
$toggle.find('i').removeClass('icon-chevron-double-up').addClass('icon-chevron-double-down');
}
else
{
$toggle.addClass('open');
$toggle.closest('.c-desc').find('div').css('height', 'auto');
$toggle.css('padding-top', ($toggle.closest('.c-desc').find('div').height() - $toggle.height()) / 2);
$toggle.find('i').removeClass('icon-chevron-double-down').addClass('icon-chevron-double-up');
}
});

View File

@@ -62,7 +62,10 @@
<?php if($suite->type == 'private') echo "<span class='label label-info label-badge'>{$lang->testsuite->authorList['private']}</span> ";?>
<?php echo html::a(inlink('view', "suiteID=$suite->id"), $suite->name);?>
</td>
<td class='c-desc'><?php echo $suite->desc;?></td>
<td class='c-desc'>
<?php $desc = trim(strip_tags(str_replace(array('</p>', '<br />', '<br>', '<br/>'), "\n", str_replace(array("\n", "\r"), '', $suite->desc)), '<img>'));?>
<div title='<?php echo $desc;?>'><?php echo nl2br($desc);?></div>
</td>
<td><?php echo zget($users, $suite->addedBy);?></td>
<td><?php echo $suite->addedDate;?></td>
<?php foreach($extendFields as $extendField) echo "<td>" . $this->loadModel('flow')->getFieldValue($extendField, $suite) . "</td>";?>