Skip to content

Commit

Permalink
Post Delete Widget: Only clickable after prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
venomgfx committed May 9, 2016
1 parent 56c1f1f commit 56ae6fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions dillo/src/themes/dillo/styles/main.sass
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,9 @@ blockquote
height: 36px
width: 36px
z-index: 1
pointer-events: none
&.active
pointer-events: initial

& #social
position: relative
Expand Down
11 changes: 8 additions & 3 deletions dillo/src/themes/dillo/templates/posts/view.jade
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ link(href="https://cdnjs.cloudflare.com/ajax/libs/jquery.swipebox/1.3.0.2/css/sw

a.edit-post-delete-widget.post-actions-button.delete(
title="Delete Post",
href="")
href="#")

span.edit-post-delete-widget-action(link="")
span.edit-post-delete-widget-icon
Expand Down Expand Up @@ -765,15 +765,20 @@ script(type="text/javascript").
});
});

$('.edit-post-delete-widget').click(function(e){
$('.edit-post-delete-widget').on('click', function(e){
e.preventDefault();
$('.edit-post-delete-widget-question').animate({'opacity': 1.0, 'left' : 6}, 350);

$('.edit-post-delete-widget-question').animate({'opacity': 1.0}, 350);
$('.edit-post-delete-widget-icon').animate({'left' : -5}, 250, function(){
$('.edit-post-delete-widget-action').attr('link', '{{ url_for("posts.delete", uuid=post.uuid) }}');

$('.edit-post-delete-widget-action').addClass('active');
});
});

$('.edit-post-delete-widget-action').click(function(e){
e.preventDefault();

$.post($('.edit-post-delete-widget-action').attr("link"), function(data){
$('.edit-post-delete-widget').fadeOut(function(){
$('#edit-post-delete-label').toggleClass('hidden');
Expand Down

0 comments on commit 56ae6fe

Please sign in to comment.