diff options
author | Mario Vavti <mario@mariovavti.com> | 2015-04-12 14:30:33 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2015-04-12 14:30:33 +0200 |
commit | 70b109702ef20d0ebad027a98964ceae1fb216c3 (patch) | |
tree | 48e7edb413af553d32051faffc5fd901d997f98f | |
parent | 962fdf08c0f3c83927ed23a1b6f384b2c3d74aae (diff) | |
download | volse-hubzilla-70b109702ef20d0ebad027a98964ceae1fb216c3.tar.gz volse-hubzilla-70b109702ef20d0ebad027a98964ceae1fb216c3.tar.bz2 volse-hubzilla-70b109702ef20d0ebad027a98964ceae1fb216c3.zip |
make dropItem more universal and move delete up in the dropdown menu
-rw-r--r-- | include/attach.php | 2 | ||||
-rw-r--r-- | view/js/main.js | 5 | ||||
-rwxr-xr-x | view/tpl/conv_item.tpl | 7 | ||||
-rwxr-xr-x | view/tpl/conv_list.tpl | 8 |
4 files changed, 10 insertions, 12 deletions
diff --git a/include/attach.php b/include/attach.php index e624734fa..e6d6e5f24 100644 --- a/include/attach.php +++ b/include/attach.php @@ -832,7 +832,7 @@ function attach_delete($channel_id, $resource) { intval($channel_id) ); - file_activity($channel_id, $object, $object['allow_cid'], $object['allow_gid'], $object['deny_cid'], $object['deny_gid'], 'update', $no_activity=false); + file_activity($channel_id, $object, $object['allow_cid'], $object['allow_gid'], $object['deny_cid'], $object['deny_gid'], 'update', $notify=0); } /** diff --git a/view/js/main.js b/view/js/main.js index 7479b17d3..d7777ea8c 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -819,13 +819,12 @@ function doprofilelike(ident, verb) { } -function dropItem(ident) { - var object = '#thread-wrapper-' + ident; +function dropItem(url, object) { var confirm = confirmDelete(); if(confirm) { $('body').css('cursor', 'wait'); $(object).fadeTo('fast', 0.33, function () { - $.get('item/drop/' + ident).done(function() { + $.get(url).done(function() { $(object).remove(); $('body').css('cursor', 'auto'); }); diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl index 7de0e05f9..facda251b 100755 --- a/view/tpl/conv_item.tpl +++ b/view/tpl/conv_item.tpl @@ -117,14 +117,13 @@ {{if $item.star}} <li role="presentation"><a role="menuitem" href="#" onclick="dostar({{$item.id}}); return false;"><i id="starred-{{$item.id}}" class="icon-star {{$item.star.isstarred}}" title="{{$item.star.toggle}}"></i> {{$item.star.toggle}}</a></li> {{/if}} + {{if $item.drop.dropping}} + <li role="presentation"><a role="menuitem" href="#" onclick="dropItem('item/drop/{{$item.id}}', '#thread-wrapper-{{$item.id}}'); return false;" title="{{$item.drop.delete}}" ><i class="icon-trash"></i> {{$item.drop.delete}}</a></li> + {{/if}} {{if $item.item_photo_menu}} <li role="presentation" class="divider"></li> {{$item.item_photo_menu}} {{/if}} - {{if $item.drop.dropping}} - <li role="presentation" class="divider"></li> - <li role="presentation"><a role="menuitem" href="#" onclick="dropItem({{$item.id}}); return false;" title="{{$item.drop.delete}}" ><i class="icon-trash"></i> {{$item.drop.delete}}</a></li> - {{/if}} </ul> </div> <div id="like-rotator-{{$item.id}}" class="like-rotator"></div> diff --git a/view/tpl/conv_list.tpl b/view/tpl/conv_list.tpl index 0d35fa685..c737c29ef 100755 --- a/view/tpl/conv_list.tpl +++ b/view/tpl/conv_list.tpl @@ -118,14 +118,14 @@ {{if $item.star}} <li role="presentation"><a role="menuitem" href="#" onclick="dostar({{$item.id}}); return false;"><i id="starred-{{$item.id}}" class="icon-star {{$item.star.isstarred}}" title="{{$item.star.toggle}}"></i> {{$item.star.toggle}}</a></li> {{/if}} + {{if $item.drop.dropping}} + <li role="presentation"><a role="menuitem" href="#" onclick="dropItem('item/drop/{{$item.id}}', '#thread-wrapper-{{$item.id}}'); return false;" title="{{$item.drop.delete}}" ><i class="icon-trash"></i> {{$item.drop.delete}}</a></li> + {{/if}} {{if $item.item_photo_menu}} <li role="presentation" class="divider"></li> {{$item.item_photo_menu}} {{/if}} - {{if $item.drop.dropping}} - <li role="presentation" class="divider"></li> - <li role="presentation"><a role="menuitem" href="#" onclick="dropItem({{$item.id}}); return false;" title="{{$item.drop.delete}}" ><i class="icon-trash"></i> {{$item.drop.delete}}</a></li> - {{/if}} + </ul> </div> <div id="like-rotator-{{$item.id}}" class="like-rotator"></div> |