Allow pin deleting from interface

This commit is contained in:
Isaac Bythewood
2013-03-03 14:30:06 +00:00
parent 8c3599911e
commit 6abb1ffe88
4 changed files with 27 additions and 2 deletions

View File

@@ -44,6 +44,19 @@ $(window).load(function() {
colHeights[sCol] += block.height()+(blockMargin);
}
// Delete pin if trash icon clicked
$('.icon-trash').each(function() {
var thisPin = $(this);
$(this).click(function() {
$(this).off('click');
var promise = deletePinData($(this).data('id'));
promise.success(function() {
thisPin.parent().parent().parent().remove();
tileLayout();
});
});
});
$('.spinner').css('display', 'none');
blockContainer.css('height', colHeights.sort().slice(-1)[0]);
}