removed inline JS, added e.preventDefault to avoid redirecting to 'false' URL
This commit is contained in:
parent
763d681eaf
commit
3b5db87c31
3 changed files with 20 additions and 8 deletions
|
|
@ -79,6 +79,7 @@ class ProjectController extends \PHPCI\Controller
|
|||
$this->_projectStore->delete($project);
|
||||
|
||||
header('Location: '.PHPCI_URL);
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<li class="nav-header">Options</li>
|
||||
<li><a href="<?= PHPCI_URL ?>build/rebuild/<?php print $build->getId(); ?>"><i class="icon-cog"></i> Rebuild</a></li>
|
||||
<?php if($this->User()->getIsAdmin()): ?>
|
||||
<li><a href="javascript:confirmDelete('<?= PHPCI_URL ?>build/delete/<?php print $build->getId(); ?>')"><i class="icon-trash"></i> Delete Build</a></li>
|
||||
<li><a href="#" id="delete-build"><i class="icon-trash"></i> Delete Build</a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -73,8 +73,12 @@
|
|||
}, 10000);
|
||||
<?php endif; ?>
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
$(function() {
|
||||
updateBuildView(window.initial);
|
||||
|
||||
$('#delete-build').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
confirmDelete("<?= PHPCI_URL ?>build/delete/<?php print $build->getId(); ?>");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
<?php if($this->User()->getIsAdmin()): ?>
|
||||
<li><a href="<?= PHPCI_URL ?>project/edit/<?php print $project->getId(); ?>"><i class="icon-edit"></i> Edit Project</a></li>
|
||||
<li><a href="javascript:confirmDelete('<?= PHPCI_URL ?>project/delete/<?php print $project->getId(); ?>')"><i class="icon-trash"></i> Delete Project</a></li>
|
||||
<li><a href="#" id="delete-project"><i class="icon-trash"></i> Delete Project</a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -80,9 +80,16 @@
|
|||
|
||||
<?php if($page == 1): ?>
|
||||
<script>
|
||||
setInterval(function()
|
||||
{
|
||||
$('#latest-builds').load('<?= PHPCI_URL ?>project/builds/<?php print $project->getId(); ?>');
|
||||
}, 10000);
|
||||
setInterval(function()
|
||||
{
|
||||
$('#latest-builds').load('<?= PHPCI_URL ?>project/builds/<?php print $project->getId(); ?>');
|
||||
}, 10000);
|
||||
|
||||
$(function() {
|
||||
$('#delete-project').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
confirmDelete("<?= PHPCI_URL ?>project/delete/<?php print $project->getId(); ?>");
|
||||
});
|
||||
})
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue