Delete link now works with directories.

Fix #452.
This commit is contained in:
bootstraponline
2012-07-27 15:02:04 -06:00
parent 387a52a7ba
commit c9bc2a89f6
@@ -3,13 +3,8 @@ $(document).ready(function() {
$('#delete-link').click( function(e) { $('#delete-link').click( function(e) {
var ok = confirm($(this).data('confirm')); var ok = confirm($(this).data('confirm'));
if ( ok ) { if ( ok ) {
var href = window.location.href; var loc = window.location;
var index = href.lastIndexOf('/'); loc = loc.protocol + '//' + loc.host + '/delete' + loc.pathname
// /home
var page = href.substr(index);
// http://localhost:4567/
var host = href.substr(0, index+1);
var loc = host + 'delete' + page;
window.location = loc; window.location = loc;
} }
// Don't navigate on cancel. // Don't navigate on cancel.