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) {
var ok = confirm($(this).data('confirm'));
if ( ok ) {
var href = window.location.href;
var index = href.lastIndexOf('/');
// /home
var page = href.substr(index);
// http://localhost:4567/
var host = href.substr(0, index+1);
var loc = host + 'delete' + page;
var loc = window.location;
loc = loc.protocol + '//' + loc.host + '/delete' + loc.pathname
window.location = loc;
}
// Don't navigate on cancel.