* Code for bug#15504.

This commit is contained in:
xieqiyu
2021-10-13 17:25:08 +08:00
parent 89be4c74c7
commit 836a35ab82
2 changed files with 11 additions and 19 deletions
+8 -18
View File
@@ -1,15 +1,20 @@
/* Set the story priview link. */
function setPreview()
{
if(!$('#story').val())
if($('#story').val() == 0)
{
$('#preview').addClass('hidden');
}
else
{
storyLink = createLink('story', 'view', "storyID=" + $('#story').val());
var concat = config.requestType != 'GET' ? '?' : '&';
storyLink = storyLink + concat + 'onlybody=yes';
if(!isonlybody)
{
var concat = config.requestType != 'GET' ? '?' : '&';
storyLink = storyLink + concat + 'onlybody=yes';
}
$('#preview').addClass('iframe');
$('#preview').removeClass('hidden');
$('#preview').attr('href', storyLink);
}
@@ -131,8 +136,6 @@ $(function()
else if(e.keyCode == 13) selectItem($selected);
});
$("#preview").modalTrigger({width:960, type:'iframe'});
$('[data-toggle=tooltip]').tooltip();
initSteps();
@@ -151,17 +154,4 @@ $(function()
});
$('#subNavbar li[data-id="testcase"]').addClass('active');
$('#story').change(function()
{
var storyID = $('#story').val();
if(storyID != 0)
{
$('#storyIdBox span').removeClass('hidden');
}
else
{
$('#storyIdBox span').addClass('hidden');
}
})
});
+3 -1
View File
@@ -15,6 +15,7 @@
<?php js::set('lblDelete', $lang->testcase->deleteStep);?>
<?php js::set('lblBefore', $lang->testcase->insertBefore);?>
<?php js::set('lblAfter', $lang->testcase->insertAfter);?>
<?php js::set('isonlybody', isonlybody());?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>
@@ -80,7 +81,8 @@
<?php if($storyID == 0): ?>
<a href='' id='preview' class='btn hidden'><?php echo $lang->preview;?></a>
<?php else:?>
<?php echo html::a($this->createLink('story', 'view', "storyID=$storyID", '', true), $lang->preview, '', "class='btn' id='preview'");?>
<?php $class = isonlybody() ? "showinonlybody" : "iframe";?>
<?php echo html::a($this->createLink('story', 'view', "storyID=$storyID", '', true), $lang->preview, '', "class='btn $class' id='preview'");?>
<?php endif;?>
</span>
</div>